#Add/Remove Physics Components at Runtime

1 messages · Page 1 of 1 (latest)

rare mulch
#

RenderMeshUtility allows us to add all the necessary rendering components to an entity at runtime. Is there something similar for physics - like a PhysicsUtility.AddComponents() ? Likewise, is there something that would remove all those components?

rare mulch
#

Add/Remove Physics Components at Runtime

rare mulch
#

Anyone?

wintry wing
#

no such thing.

#

Pretty weird request to remove all graphics comps tbh

golden zenith
#

Is there a reason you need to remove all of them instead of just something specific (index to stop it being a physics object, velocity to stop it being dynamic etc)

rare mulch
# golden zenith Is there a reason you need to remove all of them instead of just something speci...

i debated adding/removing the PhysicsWorldIndex .... but mainly I am doing some benchmarking with tens of thousands of entities, and there are quite a few physics components needed for an entity to participate in the physics sim, which take up a reasonable amount of space... resulting in a lot less entities per chunk. If there was an easy way to add/remove all physics components at runtime, it would be preferred.