*NOTE/CORRECTION:* I just realized line 216 is not necessary as it's referencing (local) basis vectors for both camera and ladder. You don't need this and it will work fine, so I recommend taking it out. In fact it may bug out if your Camera3D setup is slightly different than mine. Here you can see I simplified to just dot product of 45 degrees from up with forward move: github.com/majikayogames/SimpleFPSController/commit/d6a00968cc56cb02923a4986cb1374bd162e594b
Thank you so much for these tutorials. No one else is covering these topics, especially stair stepping. You are creating tremendous value for the Godot community!
Appreciate your comment :D I plan to add a bunch more to this series. Also working on an update to my free SimpleDungeons addon so I hope I can continue providing value to people!
Come to learn how to walk up stairs, stay for everything else. Great playlist. Really appreciate the notes/corrections in pinned comments and seeing you respond to others' suggestions in the comments.
A small improvement would be using a signal, either on the ladder or on the character, to inform the character to start climbing to avoid checking every ladder in the whole scene. Doing it this way bypasses the broad phase so it could get laggy if there are a lot of ladders. Cheers, great series
thank you. yes it might be a little faster if using signals, however the Area3D is only updated as to whether its overlapping once per frame anyway, so we still check however many ladders each frame but i thought it should be negligible as it's not actually a physics check i dont think docs.godotengine.org/en/stable/classes/class_area3d.html#class-area3d-method-overlaps-body
Will add this to my list of ideas :) I still have a bunch of tutorials to get through for this series I have planned. Next is going to be a weapon manager, HUD, and character model.
cool video, thanks for the material However, I have a question: is it possible to make the entrance to the ladders from either side? I make maps with trenchbroom, so this question is quite painful. As far as I understand, the position is determined by var pos_rel_to_ladder := ladder_gtransform.affine_inverse() * self.global_position
banger after banger tutorial, dude!! after implementing the source ladder code, my camera no longer clamps so i can do a complete vertical 360 with mouse look. i noticed this began to happen after i interacted with a ladder, would you know what's caused this to happen? ive also noticed that the camera clamp breaks when entering water, interacting/hovering with interactables, and sometimes after just seemingly nothing happening. so maybe it wasn't the ladder code? also my player no longer collides with physics objects, but sometimes when the camera clamp breaks i noticed my physics object ball get launched and spiral around in the air. sorry for all the text, i'm not trying to drop all of this onto you. im mostly concerned about the camera clamp suddenly not working under specific conditions. if it helps, i also have camera tilt and procedural weapon sway/recoil code in the FPS controller script. edit: ok i found out it was my cam tilt function that was breaking the camera clamp. weird physics object stuff still happening, but progress is progress edit 2: yo never mind turns out the whole time i had moved the sphere mesh away from the collision, nothing was "broken" this whole time in terms of physics lmfao. i was able to reintegrate my cam tilt by using %Camera3D instead of calling a Node3D that held the Camera3D as its child. everything's good in the world...
is there one for how Half-Life 2 does it, where you press the interact key and it puts you in the climbing state and then to exit the climb state, you press Interact Key or Jump Key?
I already did a video covering this :) ruclips.net/p/PLbuK0gG93AsHID1DDD1nt4YHcdOmJvWW1 This is the 8th video. The 1st of the playlist covers surf & bhop.
Thanks so much for the tutorials! These are really useful and your implementation of all of these is miles better than what i previously did. I just want to know if you'd be willing to create a video where you replicate the rocket jumping of quake into this character controller! Id really love it if you did. Heres how i currently have done it, hopefully you can improve the code! Add these two variables to the top: @export var force : float = 30.0 @export var blast_radius : float = 8.0 create a function func fire(): if Input.is_action_just_pressed("fire"): print("fire pressed") if %RayCast3D.is_colliding(): var mag = global_position.distance_to(%RayCast3D.get_collision_point()) if mag < blast_radius: velocity += (%RayCast3D.get_collision_point().direction_to(global_position) * force) * (1 - (mag / (blast_radius * 2))) and then call it in process like so: (I couldnt get the function to work anywhere else except here) func _process(delta): if get_interactable_component_at_shapecast(): get_interactable_component_at_shapecast().hover_cursor(self) if Input.is_action_just_pressed("interact"): get_interactable_component_at_shapecast().interact_with(self) fire() #THIS IS THE LINE THAT HAS CHANGED AND THAT I ADDED
*NOTE/CORRECTION:* I just realized line 216 is not necessary as it's referencing (local) basis vectors for both camera and ladder. You don't need this and it will work fine, so I recommend taking it out. In fact it may bug out if your Camera3D setup is slightly different than mine. Here you can see I simplified to just dot product of 45 degrees from up with forward move:
github.com/majikayogames/SimpleFPSController/commit/d6a00968cc56cb02923a4986cb1374bd162e594b
Thank you so much for these tutorials. No one else is covering these topics, especially stair stepping. You are creating tremendous value for the Godot community!
Appreciate your comment :D I plan to add a bunch more to this series. Also working on an update to my free SimpleDungeons addon so I hope I can continue providing value to people!
Come to learn how to walk up stairs, stay for everything else.
Great playlist. Really appreciate the notes/corrections in pinned comments and seeing you respond to others' suggestions in the comments.
Glad you enjoyed! :D
A small improvement would be using a signal, either on the ladder or on the character, to inform the character to start climbing to avoid checking every ladder in the whole scene. Doing it this way bypasses the broad phase so it could get laggy if there are a lot of ladders. Cheers, great series
thank you. yes it might be a little faster if using signals, however the Area3D is only updated as to whether its overlapping once per frame anyway, so we still check however many ladders each frame but i thought it should be negligible as it's not actually a physics check i dont think
docs.godotengine.org/en/stable/classes/class_area3d.html#class-area3d-method-overlaps-body
Awesome series so far man! Would love to see this put into a state machine! 🔥
Awesome bro 👏, this tutorial keeps getting better and better, I really hope you’re planning on adding arms, weapons, shooting and stuff like that
Yep, going to work on my SimpleDungeons addon for a bit, but after that one of the next things will be weapons & character model. Glad you enjoyed! :)
@@MajikayoGames Perfect 👍
Please show us how to make a hook / Grappling gun🤔
Please make a video on player and vehicle interaction
Will add this to my list of ideas :) I still have a bunch of tutorials to get through for this series I have planned. Next is going to be a weapon manager, HUD, and character model.
cool video, thanks for the material
However, I have a question: is it possible to make the entrance to the ladders from either side? I make maps with trenchbroom, so this question is quite painful.
As far as I understand, the position is determined by var pos_rel_to_ladder := ladder_gtransform.affine_inverse() * self.global_position
for me the jump velocity multiplier was a bit to hight but 0.5 did the job
glad it worked for you :D thanks for the comment. yeah it depends on how you want your game to feel.
@@MajikayoGames thank's, amazing tutorial series by the way
banger after banger tutorial, dude!! after implementing the source ladder code, my camera no longer clamps so i can do a complete vertical 360 with mouse look. i noticed this began to happen after i interacted with a ladder, would you know what's caused this to happen?
ive also noticed that the camera clamp breaks when entering water, interacting/hovering with interactables, and sometimes after just seemingly nothing happening. so maybe it wasn't the ladder code? also my player no longer collides with physics objects, but sometimes when the camera clamp breaks i noticed my physics object ball get launched and spiral around in the air. sorry for all the text, i'm not trying to drop all of this onto you. im mostly concerned about the camera clamp suddenly not working under specific conditions. if it helps, i also have camera tilt and procedural weapon sway/recoil code in the FPS controller script.
edit: ok i found out it was my cam tilt function that was breaking the camera clamp. weird physics object stuff still happening, but progress is progress
edit 2: yo never mind turns out the whole time i had moved the sphere mesh away from the collision, nothing was "broken" this whole time in terms of physics lmfao. i was able to reintegrate my cam tilt by using %Camera3D instead of calling a Node3D that held the Camera3D as its child. everything's good in the world...
glad you're enjoying the tutorials and glad you figured it out!
Can I by any chance download this version of the project? Without 3rd person and animations
Commit a90a00a386b0f20a885b73f7d51c775f4947b764 was the last before i added 3rd person modes
is there one for how Half-Life 2 does it, where you press the interact key and it puts you in the climbing state and then to exit the climb state, you press Interact Key or Jump Key?
any ragdoll physics?
im interested in doing a video on this but i have some other stuff planned first :)
Neat - thx
goat.
You need to teach us how to replicate the source surfing.
I already did a video covering this :) ruclips.net/p/PLbuK0gG93AsHID1DDD1nt4YHcdOmJvWW1
This is the 8th video. The 1st of the playlist covers surf & bhop.
Thanks so much for the tutorials! These are really useful and your implementation of all of these is miles better than what i previously did. I just want to know if you'd be willing to create a video where you replicate the rocket jumping of quake into this character controller! Id really love it if you did. Heres how i currently have done it, hopefully you can improve the code!
Add these two variables to the top:
@export var force : float = 30.0
@export var blast_radius : float = 8.0
create a function
func fire():
if Input.is_action_just_pressed("fire"):
print("fire pressed")
if %RayCast3D.is_colliding():
var mag = global_position.distance_to(%RayCast3D.get_collision_point())
if mag < blast_radius:
velocity += (%RayCast3D.get_collision_point().direction_to(global_position) * force) * (1 - (mag / (blast_radius * 2)))
and then call it in process like so: (I couldnt get the function to work anywhere else except here)
func _process(delta):
if get_interactable_component_at_shapecast():
get_interactable_component_at_shapecast().hover_cursor(self)
if Input.is_action_just_pressed("interact"):
get_interactable_component_at_shapecast().interact_with(self)
fire() #THIS IS THE LINE THAT HAS CHANGED AND THAT I ADDED
Player and vehicle interaction
Entry and exit to the vehicle
Please.......