- Home /
Question by
Sophisticated Lemon · Dec 07, 2014 at 11:02 PM ·
rotationmouselookatrayperspective
Trying to get a parented object to face the direction of the mouse pointer in a perspective view.
I have been looking for a solution for a while now and they all say the same thing, I'm stuck on how to make a script that does what I want it to, i have tried using ray cast and other things but only wound up in either crashing unity or going to cry in a corner (In other words I don't have any example scripts that even slightly worked) so any help from beginning to end for this would be highly appreciated. Thanks in advance!
Comment
Answer by static_cast · Dec 08, 2014 at 01:15 AM
Have you tried transform.LookAt(Camera.main.ScreenToWorldPoint(Input.mousePosition);
?
Hope it works! ;)
Your answer
![](https://koobas.hobune.stream/wayback/20220613173448im_/https://answers.unity.com/themes/thub/images/avi.jpg)