16-01-2022, 12:11 AM
Hi,
I have an object like cube and I want to cube follow the rope in real time. The rope is stretching, sagging etc. but cube should be follow given point in rope every time.
An example code to explain what I think:
I hope I could explain.
I have an object like cube and I want to cube follow the rope in real time. The rope is stretching, sagging etc. but cube should be follow given point in rope every time.
An example code to explain what I think:
Code:
float length = obiRope.CalculateLength();
Vector3 targetPosition = obiRope.GetPositionFromFloat(length / 2);
cube.transform.position = targetPosition;
I hope I could explain.