need help with mouseorbit script

Hi Guys

Iam using the mouseorbit script to make my object rotate in 360degrees it works fine.
The problem in at the start the object should face the target that it is going to move towards but instead since it takes it rotations from the mouseorbit script it does not face the target that is it does not lookat the target and faces the mouse’s directions !

I want it to look at the target first then on moving the mouse update its rotations.

thanks you :smile:

Have the script attached to an empty object. Parent the object you’re rotating to the empty object with the script. Set the rotation of the child object to be different from the parent’s rotation to whatever degree you need to eliminate the difference. If you mean that the rotation doesn’t stay off all the time than ignore that, instead you could assign transform.eulerAngles in the Start(); function.

Hi Glom

thanks for the solution I will check it out.
Actually I was trying to do that but only I made the empty object the child of the main object n forgot to take difference my bad. Having said that I am pretty bad in math can u tell me how to take the difference ? pls.