- Home /
Question by
Rally Raghavan · Mar 15, 2011 at 06:49 PM ·
errorslerpsyntax-errorrotatetowardsuce0001
doing force and spin on a gameobject when clicking on plane.
transform.rotation = Quaternion.RotateTowards(transform.rotation, hit.point, damping * Time.deltaTime);
There is an error in this line. please find what it is and tell me. Unity says,
Assets/Codes/boatForce.js(17,35): UCE0001: ';' expected. Insert a semicolon at the end.
Please help me in finding out what is the error. Waiting for a quick response. Thanks.
Comment
Best Answer
Answer by efge · Mar 15, 2011 at 06:55 PM
Use Quaternion.Slerp instead of Quaternion.RotateTowards.
ya first i used slerp. But, I want the boat to rotate only on two axes. Thats why, i chose this.
Best Answer
Answer by Rally Raghavan · Mar 18, 2011 at 07:10 AM
var rotation = Quaternion.LookRotation(hit.point - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * damping);
error solved. this code works...