Download

Get Mouse Position, Having Problems.

Hello, I’m trying to make it so when my mouse go left on the screen it goes left and actor follows the mouse but the problem is the actor is following the mouse but it’s only moving slow and it stops before I even hit the left side of my screen so if I was to move the actor from the middle of my screen and point my mouse to the left the actor would only move 10z I need it to follow the mouse like if it was like in Corporation Inc 1 ArmorGame. Anyone got a idea of how to do so?

My Current Setup!
Get Mouse Position.PNG.jpg

That calculation of mouse position will be true if u use 2d Orthographic camera. For 3d perspective camera, i think u should do line trace from World Location, to World Location + World Dir*(what number u want to put in here), then u can get hit impact point or end trace location.

I’ll give it a try

I think I usually use “get mouse position scaled by DPI” and I can’t remember having any issues with it.

Nope, he wants to get the position in world, not on screen.

This what i’m trying to do, Get the Current Mouse Position and then get that position in the world but I’m in 3D so the current setup Seen in the image I’m using 2D so I’m needing to make it work for 3D which I’m going to be doing soon. “i think u should do line trace from World Location, to World Location + World Dir*(what number u want to put in here), then u can get hit impact point or end trace location.” But I don’t understand the part where get end trace location, How would that help me when The actor won’t be hitting anything just I need to get the mouse world position has my current setup is not moving it with the mouse has it should be.

Also Could I please get some examples, I’m not new to UE4 but When you saying Get End of Trace Line My mind is like hum what do you mean by that has I am not sure what your talking about but I do know how to use the Trace Line Channel and Object.

Fixed it by redoing some of the coding it appears my old Position was still getting used, So I added in Direction * 1000 and it works perfect now :). Now I am not sure how to freeze the camera and still allow the player to move up / down / left / right.

i think i have to give u this example, sorry for my bad art :smiley:Untitled.png

Was that for the Freeze Player but allow camera to move well I don’t got a player I’m trying to just make the camera like a flash game where you use the arrow keys like up = Z, down = -Z, and left = -Y, right = Y, and that’s all I need the camera to be able to do.

i think u didnt get it, u have to learn and understand more lol, moving or not, the line trace will do the same job, and it will get the right location for you, and it doesnt matter your game have a pawn or not, the camera is controlled by player controller (can manualy controll it without player controller).Here is the quick demo Fruit Ninja style game that i made, all in 3d and 3d camera. https://www.youtube.com/watch?v=FveUg9FCZSg&feature=youtu.be
Edit: didnt notice u edit your post lol, u can disable pawn controll in your Spring Arm or in Player controller class if u make it.

Thank you, You have helped me out a lot, I wouldn’t have gotten so with out your help, Thank You Hiengs2702