#Disable colldier
1 messages · Page 1 of 1 (latest)
How many things do you need to disable/enable collision for per frame and how often is it changing?
Changing PhysicsWorldIndex is the recommended way to disable collision. I would profile the impact of the structural change if you are worried about it. If it is just a few per frame, that should not be an issue.
As an alternative, you could try swapping out the collider's physics Material with one that has CollisionResponse.None.
Swapping out the collider's physics Material do u mean create 2 physics materials and swap back and forth? Btw how this data can be sync at both client and server if I use dots netcode? I guess the physics material solution u propose is better than just changing PhysicsCollider at runtime if not require to change PhysicsCollider size?
https://forum.unity.com/threads/change-physicscollider-at-runtime.1371738/