I dont know javascript and I m new in Unity but try creating a script in your spear named eg SpearRotator and rotate it in Fixedupdate of Update. Fixed update is called every 0.02 i think..
function RotateSpear() {
var elapsedTime : float = 0;
var time : float = 1;
var startingValue = 53;
var endingValue = 96;
while (elapsedTime < time) {
transform.rotation.x = Mathf.Lerp(startingValue,endingValue,elapsedTime/time);
elapsedTime += Time.deltaTime;
yield;
}
}
All you need to do is call it once, and the spear will rotate from startingValue to endingValue in one second. If it rotates oddly, replace transform.rotation.x with transform.localRotation.x or transform.localEulerAngles.x
simply* sry
– NexgeaI dont know javascript and I m new in Unity but try creating a script in your spear named eg SpearRotator and rotate it in Fixedupdate of Update. Fixed update is called every 0.02 i think..
– Zamanis