-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KinematicBody2D Will Suddenly Launch RigidBody2D #34869
Comments
I confirm, the same thing happens when the rotation of the kinematic body is controlled via animation player (with process mode set to physics): velocity_issue.zip |
The main cause that i found is that the rotation of the kinetic body jumps from -Pi to Pi. This accelerates any touching rigid body way too much. |
I have an updated demo project that shows what @Icekey is talking about. Using the following code inside the KinematicBody2D script: extends KinematicBody2D
func _ready():
print("READY: ", rotation)
var t = 0
func _physics_process(delta):
if t <= 2:
t += delta
if t > 2:
print(deg2rad(0.1))
rotation -= deg2rad(0.1)
print("Launch: ", rotation) The KinematicBody2D doesn't appear to move, but will suddenly launch the dynamic body. However, it seems that for some reason the rotation actually goes from -PI to -PI if this output is to be believed: Additionally, this same effect can be achieved by rotating the KinematicBody2D by 2PI. Therefore, it's likely Godot's physics thinks the object has been rotated 360 degrees and has collided with the DynamicBody. |
Confirmed in 3.2.4, can't reproduce in 3.3 and later releases. |
Godot version:
v3.1.2.stable.official
OS/device including version:
Windows 10 x64
Issue description:
When colliding with a rotating KinematicBody2D, a RidigBody2D will suddenly go launching.
Velocity of the RigidBody2D:
Scene settup:
Steps to reproduce:
Minimal reproduction project:
velocity_issue.zip
The text was updated successfully, but these errors were encountered: