I added rayCast2d on the map and want it to point at my mouse position using this code
ray_cast_2d.look_at(get_global_mouse_position())
but it points with 90 degrees offset to the left (like perpendicularly). I tried to change rotation in inspector or even put it under another 2d node and change rotation there. Nothing works.
@FencerDevLog Thank you. I’ve learned something new. But I do want to rotate it. To make it point in the direction of my mouse position, not stretch it to the point. And the issue is that rayCast points perpendicularly to my mouse position. Like this:
O Ray Cast
l
l
l ------------------------------ o Mouse Position
l
l
l
V
@gertkeno I’m a newbie. So I don’t know how to do it
few minutes later: Omg! It’s worked! So all i had to do is set x to 100(for example) and y to 0 in inspector. Literally make it face right. Thank you a lot!