How to create FPS movement for Android devices?

Godot Version

Godot Engine 4.3

Question

Hello! I have created First Person movement player controller for PC.

For movement controller I use input vectors.
Basically, like this:

var input_directions = Input.get_vector("KEY_A", "KEY_D", "KEY_W", "KEY_S").normalized();
wish_direction = self.global_transform.basis * Vector3(input_directions.x, 0, input_directions.y) # this thing is used for movement like this: velocity.x = wish_direction.x * speed 
cam_aligned_wish_direction = get_active_camera().global_transform.basis * Vector3(input_directions.x,0,input_directions.y);
if camera_style == CameraStyle.THIRD_PERSON_FREE_LOOK:
	wish_direction = %thirdpersoncamera.global_transform.basis * Vector3(input_directions.x,0,input_directions.y);

My FPS movement controller also have camera movement for both First person and Third person (Player can switch between First person and Third person). All camera movement relies on if _event is InputEventMouseMotion:.

My questions are…
1.How to create android FPS movement?

Y’know like in most android games there is half-transparent joystick that you move character with. There also buttons on the screen like to jump, shoot, reload and etc.

There is also thing if you move your finger while holding joystick to other side of screen then movement will still work because player still holds the joystick.
And for camera movement in such android games the screen is usually divided in half in which the right half is used for moving camera.

You can also use both joystick and touchbuttons (jumping,shooting,reloading) at the same time.

2.How to allow players to… “position” and “scale” the touchbuttons and joystick?
There is usually also settings in android games where player can position the touch buttons by himself. Player just goes to settings and there is specific screen where he can move touch buttons to specific positions and also change the sizes of touchbuttons for more comfortable gameplay.

3.How to do all of that in godot engine?
For some reason there is REALLY SMALL AMOUNT of information and tutorials on this.

And even if there are video tutorials on how to add joystick for android movement… for some reason these video tutorials are for Android version of Godot Engine which really confuses me because why there is no tutorials on computer verison of Godot Engine on how to create movement for android?

There are a bunch of plugins for that. Here’s a list:

Hello! Thank you for answering.

Yeah, I’ve just checked that. For player movement joystick I decided to use asset “Virtual Joystick“ by MarcoFiazo.

But do you know by any chance how to add buttons like to jump, to shoot, to reload and etc.?

Also how to create settings menu in which players would be able to position and scale these buttons and joystick?

1 Like

Just use a Button node. If you haven’t learned how Control nodes work, I suggest you do that before jumping into making a UI.

Use Control nodes.

1 Like

I am afraid there would be issue when player uses joystick (holding joystick) he would not be able to press any Buttons.

To be honest I’ve also heard about TouchScreenButton. Should I use “Button” node or TouchScreenButton node?

1 Like

Use TouchScreenButton. Just looked it up and it supports multi-touch.

I am developing 3D game and because of that for player HUD I use Control node in the main “Node” game scene. Control node automatically… shows as above the 3D space like an actual interface y’know.

The joystick asset is basically part of “Control” node. Which means that if I should put joystick anywhere then I should put it in my player HUD Control node.

But TouchScreenButtons are part of “Node2D”. Is this even good practice to have “Node2D” in “Control” node? I just never seen anyone doing that in youtube tutorials and in project templates… Just want to be sure to not make a mistake while designing a game.

I do know. Which is why a couple posts up I suggested you use them.

Yup.

It’s not great, but it is what it is.

I suggest you find some videos on what you’re trying to do.

You will make mistakes. That’s life. It’s how you learn. Designing without implementing is called analysis paralysis.

1 Like

Thank you so much for answering! I will go with this!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.