Change PhysicsCollider at runtime

At dots netocode, I believe when u try to change PhysicsCollider data at runtime like changing size it will not sync data to both client and server since it’s using blob asset. Does it means I need to create custom component to handle this? Or is there any plan to make blob asset possible to sync data to both client and server in future?

1 Like

I’d recommend doing something like this:

  • Create a “ColliderSize” Component, with a “float Size” ghost field
  • Have a system that runs on both client and server, which sets the size of the collider based on that “Size” value

In other words; control the size of the collider based on some ghost field in a ghost component, and avoid changing the size every frame by only changing it if it’s different from the current size (you may want to store the last applied size in a non-ghosted field for quicker comparison)