0

Top down: Rotation look at mouse problem. How do i rotate with raycasting?

Martin Vaupell 8 months ago updated by Andrej 3 weeks ago 3

I was trying to have a top down, where character rotation, gets mouse position from mouse pointer and then rotates character facing it.

However, my attempt her, ends up in a crazy spinny loop, and it appears the angles of Y is also changing.
I tryed setting all the new vector3 to either 1 or 90 to keep the angle, but no luck.

As for raycasting, i find it strange that i dont have selected a plane or something to raycast against.

Any tips?   gladly appreciated


bc
Bolt Version:
yes current
Unity Version:
yes current
Platform(s):
yes irrelevant
Scripting Backend:
N/A
.NET Version (API Compatibility Level):
.NET 4.x

aww bollocks,,  just realized i posted in wrong forum..   'facepalm'

+1
for raycast i use this flow with layer mask

Itried this and it made my square dissappear help!