Page 1 of 1

Godot 4 FPS with Game Controller Support

Posted: Wed Jul 19, 2023 1:08 pm
by aussiegamedev
So I thought I'd post up my FPS Controller Tutorial. I also noticed a problem with the code from the YouTube. I had forgotten to limit camera movement. So at the end of the code just add the following line...

Code: Select all

$Camera3D.rotation.x = clamp($Camera3D.rotation.x, deg_to_rad(-75), deg_to_rad(75))
The code should be like this.

Code: Select all

func apply_controller_rotation():
	if (keyb):
		var axis_vector = Vector2.ZERO
		axis_vector.x = Input.get_action_strength("look_right") - Input.get_action_strength("look_left")
		axis_vector.y = Input.get_action_strength("look_down") - Input.get_action_strength("look_up")
		axis_vector = axis_vector.normalized()
	
		if axis_vector.length():
			if InputEventJoypadMotion:
					rotate_y(deg_to_rad(-axis_vector.x) * controller_sensitivity)
					$Camera3D.rotate_x(deg_to_rad(-axis_vector.y) * controller_sensitivity)
					
	$Camera3D.rotation.x = clamp($Camera3D.rotation.x, deg_to_rad(-75), deg_to_rad(75))


Link to Tutorial....



Re: Godot 4 FPS with Game Controller Support

Posted: Wed Jul 19, 2023 4:51 pm
by stayathomedev
Thanks for sharing! What are you using for the voiceover? Had to remind myself while watching.

Re: Godot 4 FPS with Game Controller Support

Posted: Wed Jul 19, 2023 9:37 pm
by aussiegamedev
That's ok. I'll eventually link the rest. I also have a few more to do, including a settings menu with save and autoload on game start.


For the voice over, I'm using ClipChamp which is free on Windows but only 1080p and also in Microsoft 365 as a paid version which does upto 4k.

le priligy sans ordonnance

Posted: Mon Nov 11, 2024 6:06 pm
by Attalfvot
Eshelman School of Pharmacy, University of North Carolina, Chapel Hill J <a href=https://fastpriligy.top/>where to buy priligy in malaysia</a>