- Home /
Question by
Venividiviciuus · Apr 18 at 03:44 AM ·
lerpupdate problem
Lerp onto splines in OnClick updating
Hi everyone, I have created objects that rotate between them by swapping their position clockwise or counterclockwise with the Vector3.Lerp method. My aim was to operate the rotation through a Button How do I make the entire rotation run by lerping my objects?
I use two distinct functions without Update
this is the source
D - E - F // With this box i created the sequences to form a curve with the Lerp method
| | My objects are found in the centers and not at the corners so are ( A , C , E , G)
C G but don't get confused the objects are named like that C
| | B D
B - A - I A
public void RotateClock()
{
interpolateAmount = (interpolateAmount + Time.deltaTime) % 1f;
// A-B //
pointAB.position = Vector3.Lerp(pointA.position, pointB.position, interpolateAmount);
pointBC.position = Vector3.Lerp(pointB.position, pointC.position, interpolateAmount);
playerA.position = Vector3.Lerp(pointAB.position, pointBC.position, interpolateAmount);
}
Comment