- Home /
Get slerp to work just as LookAt(,Vector3.right) does
Ive got my sidescroller shooter character to turn with these :
chest.LookAt(mousepos,Vector3.right);
&
chest.LookAt(mousepos,Vector3.left);
so it wont aim in to any other axis... But when the mouse gets to cross the middle of the character and not around it it gets the rotation to make a small transportation between frames and it wont get all the way to there.. It'll just teleport to its correct rotation like lookat should.
Well the question is, how do I get any quaternion slerp which works with a Time.deltTime to work as same as LookAt(,Vector3.right)? I must have the Vector3.right and left so it'll move trough 1 axis.
Many thanks to anyone who helps me out. :)
that is a remarkable use of LookAt ! I'm for one too dense to see that, you'd have to post a screen shot
there are many questions on here about lerp, slerp, LookAt
http://answers.unity3d.com/questions/26113/error-with-rotating-script.html
I$$anonymous$$PORTANT TIP:
this web site is broken (the time for being polite seems to be in the past :-/ )
the search function basically doesn't work, it just seems to log-you-out of the new log-you-in system and not do much else
so very simply search on google, it works beautifully
as the first search term, use "answers.unity3d.com"
so for this problem enter with spaces ...
"answers.unity3d.com slerp LookAt"
or perhaps lerp rather than slerp, and you will find many answers probably what you want. Hope it helps
Well, if theres anyone which knows an answer already.. then he will prevent me alot of work over searching.
Always search before. Duplicate a question is bad. Take time from everybody that was trying to help answers, and each time, got worse responses. If the amount of users here were the size of stackoverflow, this would not be a problem.
Answer by benk0913 · Jan 30, 2013 at 01:18 PM
I have used a vector2 and made it to switch directions when the mouse crosses the middle. :)
Your answer
Follow this Question
Related Questions
How to get Angle float of specific axis.(Turret clamping related). 2 Answers
Look at rotation at a moving object while moving (C#)(2D) 3 Answers
How to clamp the rotation of this? 0 Answers
Add 90 Degrees to Transform.Rotation 2 Answers
Have An Object Rotate Around Transform A So That Transform B is Looking at Transform C (C#) 0 Answers