So, I’m attempting to get the object to turn around 180 degrees. I’ve checked the doc and looked through the previous answers.
From those I’ve put together this:
public void TurnAround()
{
gameObject.transform.rotation = Quaternion.Slerp
(
gameObject.transform.rotation,
Quaternion.LookRotation(-transform.forward),
3.0f * Time.deltaTime
);
}
It doesn’t appear to function, at all - not even the slightest rotation…
What am I doing wrong?
Update 11/13/16:
Okay, so here’s how they’re rotating normally,
transform.rotation = Quaternion.Lerp
(transform.rotation, Quaternion.Euler
(m_CurrentRotation + transform.forward), Time.deltaTime);
To me it literally looks like the same logic with a faster speed and different angle but obviously…
Is your goal to have this happen progressively, over time? Where are you calling this and how often?
– TreyH@DoubleD17 Sorry, I was having a grump day... I updated the example, was able to compare highscore with it. Hopefully the fixed example works for you.
– dval