Need Help setting up a Nier::Automata Style Camera

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By druidpeter

All right. I’m at my wits end. I need help.

I want to implement a camera setup like the kind done in nier::automata. With the left joystick, I want the character to rotate and move in the direction indicated by the left joystick.

This means that if the left joystick is being pushed towards the front of the controller, the character will move forward in the game. By forward, I mean in the direction that the camera is facing. So, in the negative z direction of the camera.

If the left joystick is being pulled back away from the front of the controller, the character will rotate so that they are facing the camera, and will move towards the camera, and the camera will move back if the character gets too close.

If the left joystick is being pushed to the left or right of the controller, then the character will rotate so that they are facing the left or right side of the screen, respectively, and move in that direction. Also, in nier, the camera slowly swivels to the right or left side, respectively, as the player moves in the direction. I’m not too worried about implementing that yet. I just want to get something basic up first.

If the right joystick is pushed to the left and/or right respectively, then the camera swivels around the character, and the movement of the character updates with respect to the new camera basis.

Does anyone have any resources or know how to set up something like this? I’m not looking for complete code or anything. I’m just trying to figure up how I should set up my node tree, and which scripts to attach on what. If someone could write down the basic algorithm for how it would work, that would be great as well.

I’m at my wits end. Please, I’ve been trying to work on this for months. T_T

Thank you for your time.

Does anyone have a

:bust_in_silhouette: Reply From: anthony771

If you think about it, its basically the same as an FPS character except that your character model’s rotation is not bound to the cameras rotation, and it rotates to match its velocity vector.

I would have a look at the third person shooter demo project and that might help give you an idea on how to structure the node tree.