Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Parenting Emitters Question
#4
(22-07-2021, 08:25 PM)sothorael Wrote: I was just thinking of what is probably a newB question - if the solver is separately placed outside the character (say an invisible box in the scene) and the emitter is spawned by script, how would the solver know it? Or would the emitter/s need to exist in the character already at runtime?

The solver will update all actors -emitters- that are underneath it in the hierarchy. So as soon as you parent an emitter under a solver (at any hierarchy level, no need for it to be an immediate child) the solver will start updating it. You don't need to explicitly tell the solver which emitters to update.

Internally, the way this works is that the emitter calls GetComponentInParent<ObiSolver>() in OnTransformParentChanged(). This way, every time the emitter is re-parented, it looks for the first solver it can find above it and registers itself on that solver (and unregisters from any previous solver)

No need for the emitter/solver to exist in-editor, they can be both created at runtime.

From the manual:
http://obi.virtualmethodstudio.com/manua...olver.html
Quote:Every actor needs to have a solver up its hierarchy in order to get updated and rendered.
Reply


Messages In This Thread
Parenting Emitters Question - by sothorael - 21-07-2021, 09:18 PM
RE: Parenting Emitters Question - by josemendez - 22-07-2021, 08:58 AM
RE: Parenting Emitters Question - by sothorael - 22-07-2021, 08:25 PM
RE: Parenting Emitters Question - by josemendez - 23-07-2021, 08:38 AM