Hi, I am a bit of a beginner when it comes to scripting but what I’m trying to do is to get a platform in a 2D space go smoothly from the current angle to a new random angle on the z-axis and then, after a delay, repeat.
Any pointers to get me heading in the right direction will be most appreciated
You don’t need a coroutine to do that Update will be enough. And instead of “rotationTime” use rotationSpeed (which would be a float) * Time.deltaTime. And that should do the trick ! Oh and prefer Lerp to Slerp, if you want the rotation to increase regurlarly you need the interpolation to be linear.
EDIT: Youps, i didn’t read to the end of the sentence, didn’t saw you need to repeat the rotation, coroutine will be good in this case ^^ So instead of void Update, IENumerator yourFunction () with just a little yield return new WaitForSeconds(Random.range(…)) at the end and calling the coroutine in the Update. Sorry for my mistake $$