Hello everyone. I am having a lot of trouble trying to make this behaviour.
I’ll attach you the blueprint that i made and a video link showing the problem.
Hello everyone. I am having a lot of trouble trying to make this behaviour.
I’ll attach you the blueprint that i made and a video link showing the problem.
I like the following method because it’s so universal and incredibly flexible:
If you print out the mouse position, you’ll see it has nothing to do with the X position of your actor. That’s the main problem.
I don’t usually work with flat D, so don’t have a good answer yet…
Thank you for the answer.
In this way my actor rotates in the z axis, not sure why. My actor should rotate on the y axis, to point the opposite
position of my mouse cursor
You’re seeing weird results because MouseX is a value between 0 and the maximum horizontal resolution of your display, it can be several thousand pixels if you’ve got many monitors…
Lets say we’re dealing with 1920x1080 only, though:
Essentially, it’s what ClockworkOcean says in his comment, screenspace (mouse location) is very different from world space. We need a translation.
To visualise what I mean:
Hope this makes sense.
This is a great method if you want to rotate things at arbitrary angles but can’t afford / don’t want to rely on geometry.
Hello Everynone. Thank you for the answer, i did it and it’s working perfectly, i’m so happy that its finally working! Thank you so much!