Hey everyone. I am trying to figure out some of the basics in unity and have run into bit of a problem. I have a character with a character controller component attached as am using the sidescrollcontrol script from the unity mobile assets. I have a functioning rope that swings and I am just trying to set the position of my character to the position of the rope (its actually the final link in the rope), so it would look like my character is swinging from the rope.
I wasn’t sure how to do this and have tried using OnTriggerEnter/OnTriggerStay/OnCollisionEnter to no avail. From what I can tell the function is only called once, so the character initially jumps to the correct position at the end of the rope but then thats it… The position was set once and the character falls to the ground and the rope continues swinging. I am wondering if there is a built in function in unity or a reasonable scripting solution to keep my character position equal to the position of the rope?
function OnTriggerStay(){
transform.position.x = finalLink.position.x;
transform.position.y = finalLink.position.y;
}