+1 vote

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

Godot version 3.1.1
in Engine by (18 points)

1 Answer

0 votes
Best answer

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.

by (44 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.