Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it able to move softbody with script?
#11
(14-11-2019, 10:39 AM)josemendez Wrote: Hi Manu,

The video you sent causes VLC, Quicktime and Media Player to crash, so I'm unable to see it.

When setting positions directly you also need to set the inverse mass and the velocity of these particles to zero, as I pointed out before. Setting the inverse mass to zero deactivates dynamics for that particle (as you will be setting its position directly, and you don't want the simulation to overwrite it), and removing all its velocity will make sure it doesn't drift away from the position you set.

Once you "release" the particle, simply set its inverse mass to whatever it was. The simulation will take over and begin setting both its position and velocity.

From the manual:
http://obi.virtualmethodstudio.com/tutor...icles.html

You don't need to download the video to watch it, it supports online play.
I already did it with 

solver.invMasses[pickArgs.particleIndex] = 0f;
solver.velocities[pickArgs.particleIndex]= Vector4.zero;

saving the last invMass, but I'm getting this:

transform.position assign attempt for 'Dragon' is not valid. Input position is { NaN, NaN, NaN }.
UnityEngine.TransformConfundidoet_position(Vector3)
Obi.ObiSoftbody:OnSolverStepEnd(Single) (at Assets/Obi/Scripts/Actors/ObiSoftbody.cs:65)
Obi.ObiSolver:AllSolversStepEnd() (at Assets/Obi/Scripts/Solver/ObiSolver.cs:877)
Obi.ObiArbiter:WaitForAllSolvers() (at Assets/Obi/Scripts/Solver/ObiArbiter.cs:45)
Obi.ObiSolver:WaitForAllSolvers() (at Assets/Obi/Scripts/Solver/ObiSolver.cs:784)
Obi.ObiSolver:SimulateStep(Single) (at Assets/Obi/Scripts/Solver/ObiSolver.cs:672)
Obi.ObiSolver:FixedUpdate() (at Assets/Obi/Scripts/Solver/ObiSolver.cs:866)

And multiple clusters errors like:

transform.position assign attempt for 'Cluster102' is not valid. Input position is { NaN, NaN, NaN }.
UnityEngine.TransformConfundidoet_position(Vector3)
Obi.ObiSoftbodySkinner:UpdateBones(Object, EventArgs) (at Assets/Obi/Rendering/ObiSoftbodySkinner.cs:122)
Obi.ObiSolver:EndFrame(Single) (at Assets/Obi/Scripts/Solver/ObiSolver.cs:727)
Obi.ObiSolver:LateUpdate() (at Assets/Obi/Scripts/Solver/ObiSolver.cs:905)

The dragon disappears.

Btw, the examples from the manual do nothing
Reply


Messages In This Thread
RE: Is it able to move softbody with script? - by manurocker95 - 14-11-2019, 10:51 AM