You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pretty much what the title says. Reparenting a common ancestor of a CharacterBody2D and a TileMap to or from a SubViewport will cause their collisions with each other not to work. Interestingly enough, changing the collision_animatable field of the TileMap - which I guess flushes its collision or something - after reparenting, fixes this issue.
To be sure, I've checked reparenting to a regular Node2D, and also to a plain Node - it seems that this bug is specific to reparenting to a SubViewport. I've also not had this issue with collision objects other than a TileMap (static collision objects for instance do not experience this bug).
Steps to reproduce
Attached below is a minimal reproduction project, with a CharacterBody2D moving up and down in a loop, and a tilemap containing two bars that block the CharacterBody2D's motion.
Pressing the down key reparents them to a SubViewport node, which is displayed on screen via a Sprite2D with a ViewportTexture (intentionally slightly smaller so you can distinguish the difference). If it's pressed again, the two are reparented back to their original node. You will notice that after pressing the down key, the CharacterBody2D will pass through the tilemap.
Pressing the up key will toggle the tilemap's collision_animatable flag, fixing the bug until the down key is pressed again.
Godot version
4.2.beta4
System information
Godot v4.2.beta4 - Windows 10.0.19045 - GLES3 (Compatibility) - Intel(R) UHD Graphics 620 (Intel Corporation; 31.0.101.2125) - Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (8 Threads)
Issue description
Pretty much what the title says. Reparenting a common ancestor of a CharacterBody2D and a TileMap to or from a SubViewport will cause their collisions with each other not to work. Interestingly enough, changing the
collision_animatable
field of the TileMap - which I guess flushes its collision or something - after reparenting, fixes this issue.To be sure, I've checked reparenting to a regular Node2D, and also to a plain Node - it seems that this bug is specific to reparenting to a SubViewport. I've also not had this issue with collision objects other than a TileMap (static collision objects for instance do not experience this bug).
Steps to reproduce
Attached below is a minimal reproduction project, with a CharacterBody2D moving up and down in a loop, and a tilemap containing two bars that block the CharacterBody2D's motion.
Pressing the down key reparents them to a SubViewport node, which is displayed on screen via a Sprite2D with a ViewportTexture (intentionally slightly smaller so you can distinguish the difference). If it's pressed again, the two are reparented back to their original node. You will notice that after pressing the down key, the CharacterBody2D will pass through the tilemap.
Pressing the up key will toggle the tilemap's
collision_animatable
flag, fixing the bug until the down key is pressed again.Minimal reproduction project
tilemap_reparent_mrp.zip
The text was updated successfully, but these errors were encountered: