1 The whole scene have a floor and many soft ball on floor. when I run ,I manual rotate the floor fast. I found sometime solver stop suddenly.
Any idea?
2 I want to get position of ball, how to coding?
Thanks
Quote:The whole scene have a floor and many soft ball on floor. when I run ,I manual rotate the floor fast. I found sometime solver stop suddenly.
Can you record a video of this happening? there's no reason for a solver to stop.
Quote:I want to get position of ball, how to coding?
Softbodies automatically update their transform. So you can just do:
Code:
Vector3 position = ball.transform.position;
ball.transform.position is
incorrect
I was wrong you are right
I found function in ObiActor.cs
public Vector3 GetParticlePosition(int index)
how to get "index"?
Hi,
I want to know how to reset particle’ position during simulation?
(01-02-2019, 12:16 PM)_gaoyu_ Wrote: [ -> ]Hi,
I want to know how to reset particle’ position during simulation?
Hi,
simply assign the rest position to the position:
Code:
solver.positions[ball.particleIndices[i]] = ball.restPositions[i];
Note that this will reset the actor to the center of the scene, since restPositions are expressed in local space, while solver positions are expressed in world space. You might want to convert them using Unity's TransformPoint or InverseTransformPoint methods, It depends on whether you want to reset its deformation only, or completely reset all positions.