16-11-2021, 10:59 AM
(This post was last modified: 16-11-2021, 11:05 AM by josemendez.)
(16-11-2021, 10:57 AM)srid96 Wrote: I also did that code before you replied, my object positions to the obi rope (gameobject) position, not the end of rope.
Maybe your rope's end is actually your rope's start ?
It depends on how you've placed the control points, or if you've rotated the rope. Try the first particle instead:
Code:
var lastPos = solver.renderablePositions[actor.solverIndices[0]];
Also, make sure the object that has this script is not a parent of either the solver or the rope. If it is, moving the object will also move the rope (because of parenting), so you won't ever be capable of placing the object at the rope's end: as soon as you move the object, the rope moves too! It's like a cat-and-mouse chasing game.
I mention this because you're using GetComponentInChildren() to get the solver and rope references... It's fine if the bomb is not "this" object though.