Chaos destruction disable after x seconds

Hi, i want to have a destructible vase in my game. And for this i want to use the new chaos destruction system. Super simple: vase is asleep with player collision-> player create an area where damage to the vase is applied (eg by rolling or attacking) → vase gets destroyed with physics → after x seconds disable the simulation and disable collision

the first steps are not the issue but how do i disable collision or put the simulation to sleep without using field systems? I just want to do it in code after x seconds but didnt find anything on the geometry collection (dont want to put everything asleep just the one vase). Same goes for collision. Changing the geometryCollection collision after destruction is not working.

Another thing i dont understand is the mass of the destruction. I want the player to push the parts away and not step on it. Even if i set mass to 0 and disable can character step on it is not working as expected.

im so confused it just dose not work … i tried GeometryCollection->SetDynamicState(Chaos::EObjectStateType::Sleeping) but nothing happens. And another thing is I cant change the collision after begin play. It dose not update on the geometry collection children. Im just confused how this is supposed to work without using the fields workflow witch is not suitable for all scenarios.

I think you have a couple of options. 1) Add an FS_SleepDisable_Generic actor on the floor, change the Field Behaviour to kill and the adjust the threshold to match what you want. 2) In the geometry collection, change the Removal parameters like Sleep min/max and removal duration.

You can also register for the OnChaosBreakEvent on the geometry collection in your BP/Code then do whatever you want - add a disable field, change the collision, etc.

to manually disable GeometryCollections i found this solution without using a field:

	if (Chaos::FPhysicsSolver* RBDSolver = GeometryCollection->GetPhysicsProxy()->GetSolver<Chaos::FPhysicsSolver>()) {
		RBDSolver->EnqueueCommandImmediate([this, RBDSolver]() {
			TSet<Chaos::FPBDRigidClusteredParticleHandle*> Processed;
			for (auto handle : GeometryCollection->GetPhysicsProxy()->GetParticles()) {
				if (handle) {
					RBDSolver->GetEvolution()->DisableParticleWithRemovalEvent(handle);
				}
			}
		});
	}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.