27-04-2020, 03:17 PM
(This post was last modified: 27-04-2020, 03:21 PM by josemendez.)
Hi there,
You can use actor.SaveStateToBlueprint(blueprint). This will save current particle positions and velocities to a blueprint. Make sure you save to a copy of your current blueprint, though! (that is, var passThisOne = Instantiate<ObiActorBlueprint>(rope.blueprint); )
Then use it the next time you want to instantiate the actor.
Btw, this is the method Obi uses internally when you switch to a new solver at runtime, to ensure data from the current solver is passed on to the new one: before leaving the current solver, it calls SaveStateToBlueprint on a copy of its current blueprint, and after entering the new solver, it loads this copy instead of the original blueprint.
cheers!
You can use actor.SaveStateToBlueprint(blueprint). This will save current particle positions and velocities to a blueprint. Make sure you save to a copy of your current blueprint, though! (that is, var passThisOne = Instantiate<ObiActorBlueprint>(rope.blueprint); )
Then use it the next time you want to instantiate the actor.
Btw, this is the method Obi uses internally when you switch to a new solver at runtime, to ensure data from the current solver is passed on to the new one: before leaving the current solver, it calls SaveStateToBlueprint on a copy of its current blueprint, and after entering the new solver, it loads this copy instead of the original blueprint.
cheers!