Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Setting velocity to 0
#1
Hello

I am trying to set the velocity of cloth particles to 0 so that there is no more movement with the following code:

Code:
ObiNativeVector4List velocities = actor.solver.velocities;
ObiNativeVector4List angularVelocities = actor.solver.angularVelocities;
ObiNativeVector4List forces = actor.solver.externalForces;
ObiNativeVector4List torques = actor.solver.externalTorques;
           
    for (int i = 0; i < actor.solverIndices.count; i++)
    {
        int solverIndex = actor.solverIndices[i];
        velocities[solverIndex] = Vector3.zero;
        angularVelocities[solverIndex] = Vector3.zero;
        forces[solverIndex] = Vector3.zero;
        torques[solverIndex] = Vector3.zero;
    }
actor.UpdateParticleProperties();

I execute this code once a certain action occurs in the game.
It works when damping is set to 0.5 but when I reduce the damping I see particles start to move again.
Can you point me in the right direction and verify if I am using the right code to do the job?

Thanks
Aroosh
Reply


Messages In This Thread
Setting velocity to 0 - by Aroosh - 06-12-2025, 09:37 PM
RE: Setting velocity to 0 - by josemendez - 07-12-2025, 12:35 PM
RE: Setting velocity to 0 - by Aroosh - 08-12-2025, 12:12 AM
RE: Setting velocity to 0 - by josemendez - 08-12-2025, 09:24 AM
RE: Setting velocity to 0 - by Aroosh - 20-12-2025, 01:06 AM
RE: Setting velocity to 0 - by chenji - 22-12-2025, 04:29 AM
RE: Setting velocity to 0 - by josemendez - 22-12-2025, 08:38 AM
RE: Setting velocity to 0 - by Qriva0 - 22-12-2025, 11:26 AM