Download

3D Maths / diirectional controls help

I’m currently creating a game that is viewed from static cameras, whilst an analogue stick is used for movement. Think the new controller option for the recent Resident Evil remake on the PS4/XB1/PC.

I’ve got the left / right movement set up so that the player character will move horizontally across the screen ok. However, I don’t know how to set up the up / down movement to be vertically aligned to the screen in 2D, rather than towards / away from the vanishing point in 3D.

Here’s my current set up:

The floats coming in from beyond the left hand side of the screen are the move forward & right axis values.

I suspect the maths here is quite complicated, because as the player gets further away from the centre of the screen, they’re actually moving across the world in curve in order to adhere to a strict up / down movement in relation to the final 2D image. Does anyone know how I should handle that?

And is my left / right work ok, or would the character be moving along a curve to?

It’s worth noting that the floats coming in from beyond the left hand side of the screen are the move forward & right axis values.