Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi Handle and fixing particles at runtime
#5
(14-09-2019, 11:13 AM)josemendez Wrote: Hi,

If adding a handle at runtime, particle masses are not modified until the actor gets added to the solver at the start of the scene. So you're actually calling the code I gave before the masses are modified, not after.

You could call this by subscribing to the solver add event, but for ease of use I modified ObiParticleHandle.cs for you to do it automatically. Find the code attached.

trying both scripts gives me:

Invalid localAABB. Object transform is corrupt.


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)

(14-11-2019, 12:26 PM)manurocker95 Wrote: trying both scripts gives me:

Invalid localAABB. Object transform is corrupt.


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)

Closing Unity and opening it again made it working but I have the same issue. Can you provide an example scene where handles are created in runtime?

Reply


Messages In This Thread
RE: Obi Handle and fixing particles at runtime - by manurocker95 - 14-11-2019, 12:26 PM