This question was created in reference to: [Is it possible to set two physics objects to not collide with [Content removed]
________________________________________________________________________________________________________________________________________________________________________
Hi there,
I am spawning an actor with Physics collision inside of another.
FChaosEngineInterface::AddDisabledCollisionsFor_AssumesLocked, as suggested in the referenced question, is (I assume) the “correct” way to disable collisions on a particle to particle basis.
However
That method has to be performed inside an asynchronous callback of FPhysicsCommand::ExecuteWrite, because the physics scene has to be locked before the operation can be processed.
This means that, in the case of spawning a particle within another, I have to adhere to the following sequence:
- Spawn Actor (Particle)
- Disable Physics Collision
- Lock Physics Thread
- Wait
- FChaosEngineInterface::AddDisabledCollisionsFor_AssumesLocked
- Enable Physics Collision
- Add Impulse
- etc.
The undesirable part of this sequence is having to wait for the callback before being able to do anything with the actor’s physics.
________________________________________________________________________________________________________________________________________________________________________
Is there a better way to implement my desired functionality?
What would you suggest?
Kind regards,
Josh