{"id":116,"date":"2025-06-06T20:49:57","date_gmt":"2025-06-06T20:49:57","guid":{"rendered":"https:\/\/cyberwraith.rainydays-games.com\/?p=116"},"modified":"2025-06-06T20:49:57","modified_gmt":"2025-06-06T20:49:57","slug":"dragon-is-working","status":"publish","type":"post","link":"https:\/\/cyberwraith.rainydays-games.com\/?p=116","title":{"rendered":"Dragon is working"},"content":{"rendered":"\n<p><em>Original date: <time datetime=\"2022-07-02T17:11:00-07:00\">July 02, 2022<\/time><\/em><\/p>\n\n\n\n<p>Okay&#8230; so this nearly drove me crazy.<\/p>\n\n\n\n<p>The walls of the levels are made with tilemaps. I have, for example, a bullet that is of type Area2D and when that bullet registers a collision with the wall\/tilemap, it deletes itself. Simple.<\/p>\n\n\n\n<p>I used exactly the same way to detect a collision with a probe object that would tell the Dragon if there is something in the way or not. Basically, the dragon randomly chooses a set of coordinates to jump to and spawns a probe object at those coordinates. If the object collides with something, it sends a signal to the Dragon and suicides, then the Dragon tries again. If no signal is received, the Dragon goes ahead and jumps.<\/p>\n\n\n\n<p>However, whatever I did, the probe would not register any collisions with the tilemap. How can it be that if you do something, it works, but if you do it again, it doesn&#8217;t? I checked the settings, they were the same. Collision mask, code, everything.<\/p>\n\n\n\n<p>What eventually made it work was to tell the tileset to handle collisions as if it was a kinetic body rather than a static body. I have no idea what exactly that does, especially since tiles cannot move, but when I checked that box it works. Strangely enough, that was NOT necessary for the bullet thing to work.<\/p>\n\n\n\n<p>A possible explanation would be that even though it&#8217;s the same detection (on body entered), it makes a difference wether the object moves against the collider or spawns inside of it.<\/p>\n\n\n\n<p>Well, it works now. I just need to remember to check that box in the future. And to keep an eye out for any possible changes in behavior.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Original date: July 02, 2022 Okay&#8230; so this nearly drove me crazy. The walls of the levels are made with tilemaps. I have, for example, a bullet that is of type Area2D and when that bullet registers a collision with the wall\/tilemap, it deletes itself. Simple. I used exactly the same way to detect a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-uncategorized","post-preview"],"_links":{"self":[{"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=116"}],"version-history":[{"count":1,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":117,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions\/117"}],"wp:attachment":[{"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cyberwraith.rainydays-games.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}