Hello,
I made a script to add a more realistic movement on my flashlight. it works well, but it's not smooth enough. Here's a video I uploaded to show you the problem.
[video][1]
Notice how the flashlight doesn't move smoothly.
Here's my script
#pragma strict
var target : GameObject;
var speed : float;
function Start () {
}
function Update () {
transform.position = Vector3.Slerp(transform.position, target.transform.position, Time.time * speed);
transform.rotation = Quaternion.Slerp (transform.rotation, target.transform.rotation, Time.time * speed);
}
[1]: https://www.youtube.com/watch?v=ftQPSbavPcA
What can I do?
Thanks
↧