-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Reload kinematic shapes when changing PhysicsBody mode to Kinematic #53118
Reload kinematic shapes when changing PhysicsBody mode to Kinematic #53118
Conversation
…o prevent a crash when calling test_body_motion. Call reload_kinematic_shapes from init_kinematic_utilities as they are always called together.
Fixes #53125 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding the issue and fixing it!
It looks great. I was just wondering, why did you decide to revert the change to avoid calling init_kinematic_utilities()
directly when switching to Kinematic mode? Was it causing issues in some cases?
It don't think it causes issues either way but I think that the majority of cases for a PhysicsBody in Kinematic mode may be the KinematicBody nodes. So in that case, I think it makes more sense to initialize everything needed by kinematic methods at the body's initialization, not at the first call of a kinematic method. It was also one less change so I thought it was less risky. But either way is OK with me! |
Alright, sounds good to me then :) It does make sense to just focus on fixing the crash in this PR. |
Congrats on your first merged PR! |
Cherry-picked for 3.4. |
This complements the PR #51857, as there is still a crash when changing the mode to Kinematic.
Reload kinematic shapes when changing PhysicsBody mode to Kinematic to prevent a crash when calling test_body_motion.
Call reload_kinematic_shapes from init_kinematic_utilities as they are always called together.
Bugsquad edit: Fixes #53125.