![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | lazarski |
Hello everybody, I’m new to godot engine and I came with what I think is a common problem with collisions between different type of nodes (KInematic, RigidBody, etc…) Right now I have the following nodes:
- RigidBody2D represents a movable bush object.
- KInematicBody2D represents the player.
- StaticBody2D, represents the walls.
There are two problems mainly, in the first one the player push the bush object against the wall (the player also follow the object) and then this bush goes through the wall and continues his path. Another problem involves the bush keeping itself above the wall when pushed by the player, and when I move the player in the opposite direction, the bush comes along with the player, like it’s glued to him. Some other times when the bush is pushed onto the wall it swaps positions with the player. I have read that the object flying through walls may be caused by tunnelling, but the object glued to the player seems weird.
Those problems do not happen when the player pushes the object in any direction against walls and does not follow it.
My question is simple: Is there some tweaks to prevent these behaviours from happening? Or that kind of “corner” cases must be handled by code? I want to know what are the limits of the default physics engine in Godot to know what to expect from it. I have already taken chances with continuous CD or increasing the physics fps. Thanks in advance and have a nice day!
Update:
To clarify i let here a link to check the problem with the bush following the player: https://gfycat.com/inconsequentialconcerneddegu
Player movement code:
It is hard to imagine. Can You post some video of these issues ? And post your code please, because these are not typical issues with physics engine, it must be related to your follow function somehow
Inces | 2021-11-21 15:54
Hi, thanks for your reply! I don’t have any code related to the bush following the player, it seems like a default behavior. A couple of details: Bush is a rigidbody2D with a sprite and collision shape as well as the player but with a kinematicBody2D type and rectangle shape instead of a circle shape for collisions. The walls come from tileset objects with collision defined. My only code regarding movement is on the player, and it’s a pretty basic movement algorithm and does not have anything to do or refer in any way to the bush object.
lazarski | 2021-11-21 19:17