Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | att |
How to nnable or disable rigid body at runtime?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | att |
How to nnable or disable rigid body at runtime?
Reply From: | wombatstampede |
Depends on what you exactly mean with disable.
You could set sleeping
to true. It should then stop moving unless it is hit by something.
You could set the mode
to MODE_STATIC
then it stays where it is and ignores all forces but other things can still collide with it.
You could set collision_mask
and collision_layer
to 0 or (alternatively) disable all collision shapes of the rigidbody. Then no collision would take place.
And naturally you can toggle the visibility. It might also be convenient to link actions which I named above to a visibility notification. All depending on what you exactly want…