Rotating a Model
First of all, sorry my newbiness and my bad english (not a native speaker)
Ok, so i need this Hammer to automatically follow this path after i press the space button, everything is working except the fact that i cannot make it rotate towards that point (only in that local axis), and then come back, i've tried the followings:
Quaternions.RotateTowards
Quaternions.Slerp
Transform.Rotate
Quaternion.FromToRotation
Quaternion.AngleAxis
Even tried to transform.Rotate, then Quaternion.Angle, if the angle is bigger than 130 return (my logic tells mi that), and if its less than 5 stop.
I've managed to make it go all the way, but not able to go back.
Thanks in advance, Ian
Answer by eralier · Jul 16, 2016 at 05:01 AM
You should use an animation for that I'd would be simplier than coding it, I think. Check this post http://answers.unity3d.com/questions/1164347/how-to-lauch-an-animation-from-a-script.html and adapt it to your problem. To learn how to animate in Unity : http://unity3d.com/learn/tutorials/topics/animation
You could also make the animation in Blender if you're familiar with it