Movement according to location of mouse on screen

Hello,

I’m trying to make a spaceship (also the player) to move continuously according to the location of the mouse on screen using blueprints. 
For example, when the crosshair in on the top middle of the screen the spaceship will continuously pitch upwards, same goes to the yaw.
They did the same in Everspace (EVERSPACE™ on Steam)

Thanks for any help

If you just want up/down, then something crude like this will do:

If you need something more advanced, you’d want a directional vector from the centre of the screen to mouse position. Not only would this give all directions but also the distance from the centre which can be then interpreted as speed - the further you’re from the screen centre with the cursor, the faster you go.

Thank you soo much,

can you show me or explain a little bit more about the second method ?

Here’s what I mean, you can get a direction and distance relative to the centre of the screen like so:

I put it in the HUD class, it makes it easier to draw 2d debug on screen:

https://gyazo.com/33dd705a9b7bae25900ccbea062675eb

Print those values and observe them change - this should give you an idea regarding how to apply them to yaw/pitch. The number here shows the distance, you can use is as speed when calculating rotation interpolation.

I’m really new to all of this and you have been so much help, though i still don’t really know how to translate this to the spaceship movement

The most basic setup would look like this:

https://gyazo.com/8eee5ed2c3eefd444f78c60541373db4

However, what you really need is a solid 6DoF, handling gimbal locks.

In order to get this working properly, you’d need to set up proper movement first. And only then worry about adding mouse screen input speed.

If you’re new to all this, may I suggest you start with a [6Dof][2] tutorial:

https://forums.unrealengine.com/community/community-content-tools-and-tutorials/1217-tutorial-6-dof-flying-pawn-like-descent

Link to the tutorial is in the very first post. Once you have it working, what I said above should make more sense.

Thank you so much for all the help.

I know it may sound a bit exaggerated but can you send me this spaceship project to understand exactly how you did that ?

if you prefer not to its totally understandable

It’s a project where I mess around with random things, it’s such a mess that I do not know what’s what.
I duplicated the 2 blueprints that are used and cleaned them up a bit:
https://drive.google.com/drive/folders/10lVhop8jESs-h9oOx92ThEfXF8NiQ6K1

The Pawn seems to be default with a mesh, camera and springarm, you just need to assign it your own static mesh. The controller is pretty much default as well. It handles all logic seen above.

If you want to use custom pawn and controller, you’ll need a custom GameMode: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/SettingUpAGameMode/Blueprints/index.html

You can’t do much without them anyway.

Hey Everynone,
could you reup the project? I have still problems getting this working for a spaceship.

Regards,
Darkentik

@Darkentik, just saw this. I no longer have it. Sorry.