hi everyone.
i have a coroutine that looks like this
private IEnumerator StartRotation(
Quaternion curPos,
Quaternion targetPos,
float t
)
{
float counter = 0;
while ( counter < t)
{
counter += Time.deltaTime;
transform.rotation = Quaternion.Slerp(curPos,targetPos,counter);
yield return null;
}
}
well, it's working, but i need two more things and i can't figure out hot to do it...
- i want to be able to pingpong gameobject between this two rotation
- maybe is a noob question but if i want that slerp complete the rotation in 1 second, ho i should set it?
i'm confused.. someone can help me please?
thank's you in advance
↧