#Disable colldier

1 messages · Page 1 of 1 (latest)

misty cairn
#

Any plan to make PhysicsWorldIndex to be Enableable component that able to enable/disable component which causing structural changes since currently I need to change the value of PhysicsWorldIndex to disable collider and it causing structural changes?

nova dawn
#

How many things do you need to disable/enable collision for per frame and how often is it changing?

nova dawn
#

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.

misty cairn
# nova dawn Changing PhysicsWorldIndex is the recommended way to disable collision. I would ...

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/