i want to disable rb and enable them when i need it to.
sleep or col detection off wont help since the cost remain the same for my game, but removing the rb helps, so i really want to disable rb and enable when needed for my particular situation
how can i go about this, guys?
Why would unity remove the enabling/disabling of rb in the 1st place?
Yeah, Unity removed this a while ago.
The closest you can get is making it Kinematic and disabling collisions. The processing cost should be much lower for a Kinematic with no collisions.
Or, you could always add a child object and move any colliders and rigidbodys over, then when you want to disable the rigidbody you could just disable the child object.
I’m guessing that the problem was that when you disabled a Rigidbody component, what should be done with all the attached colliders? Colliders only attach to a Rigidbody that is active on the same GameObject are on a parent GameObject. Disabling the Rigidbody would mean they’d not attach to it and therefore they’d be static which isn’t probably what you’d want.
Disabling a GameObject is more expensive than disabling a single component but it all depends on what components are on the GameObject and its children.
When I implemented the 2D physics stuff, for this reason, I did not allow the Rigidbody2D to be disabled as the required behaviour wasn’t very clear and different users would want different things. This is why I added the option I mentioned above which has a well defined behaviour, only affects the Rigidbody, joints and colliders and is very fast.