Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in the FPS Tutorial #86

Open
JamesC01 opened this issue Mar 15, 2021 · 4 comments
Open

Bug in the FPS Tutorial #86

JamesC01 opened this issue Mar 15, 2021 · 4 comments

Comments

@JamesC01
Copy link

JamesC01 commented Mar 15, 2021

Hi, there's a bug in the FPS tutorial. To move, it uses the camera's global_transform.basis, so if you look upwards, the player won't move as fast, and if you look straight up, you won't be able to move. It should use the kinematic body's (FPSCharacter) global_transform.basis, which gives typical FPS movement, and ignores the rotation of the camera. The video should also be updated.

Also a small recommendation: I'm new to godot, so this may be a bad suggestion, but when doing:
rotation_helper.rotation.x = clamp(rotation_helper.rotation.x, -1.2, 1.2)
I personally find it more understandable to use degrees:
rotation_helper.rotation_degrees.x = clamp(rotation_helper.rotation_degrees.x, -90, 90)
Maybe other's would agree too. It's just a bit easier to visualize.

@cbscribe
Copy link
Member

Thanks for the suggestion - I'll update the recipe. Not so easy to update the video though...

@JamesC01
Copy link
Author

JamesC01 commented Mar 18, 2021 via email

@JamesC01
Copy link
Author

JamesC01 commented Mar 18, 2021

Also, weird thing, using the transform of the player seems to get the exact same results as global_transform, and when I checked, they are both the same value. edit: actually, I think basis.x gets the body's right direction in world space, so it may make more sense to use transform.basis.x instead of global_transform.basis.x. I'm not really sure of the difference in this case. Maybe you know. edit: actually no, global_transform is better. transform seems to change if you change the rotation of the player's parent node, which is not right.

@JamesC01
Copy link
Author

JamesC01 commented Mar 20, 2021

A pinned comment on the video correcting the code would be good for the meantime. And a correction in the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants