- Home /
Question by
tomasherrera · Jun 24, 2011 at 05:32 AM ·
2drotationrotateshooter
Its this possible?
i want to rotate my character´s weapon to point to my mouse cursor like a 2d shooter, ive tried a lot but i cant do it, please somebody help me, even a guide or any ideas will be hopeful!! thanks
Comment
Answer by testure · Jun 24, 2011 at 05:36 AM
transform.LookAt(Input.mousePosition);
done like dinner.
that does not work i already trie, thats for 3d games i think, $$anonymous$$e is a 2d shooter. but thank you anyway
You have to pass worldspace coordinates derived from a conversion of the cursor's screenspace coordinates rather than the actual cursor position, but that's basically the idea.