08-02-2022, 10:57 AM
Hi,
I wanted to increase the length of a rope toward a maximal length. I used a code based on manual :
However, in runtime I observed a weird behavior : https://imgur.com/a/geSDfoW. The length of the rope is increasing, but at the same time the rope is moving in the direction of the cursor.
Is there anything I'm doing wrong ?
I wanted to increase the length of a rope toward a maximal length. I used a code based on manual :
Code:
void Update()
{
if (_obiRope.restLength <= _lengthMax)
{
_obiCursor.ChangeLength(_obiRope.restLength + 0.2f * Time.deltaTime);
}
else
{
Debug.Log("Can't increase more");
}
}
However, in runtime I observed a weird behavior : https://imgur.com/a/geSDfoW. The length of the rope is increasing, but at the same time the rope is moving in the direction of the cursor.
Is there anything I'm doing wrong ?