-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix look_at_from_position()
usage in Your first 3D game tutorial
#10666
base: master
Are you sure you want to change the base?
Fix look_at_from_position()
usage in Your first 3D game tutorial
#10666
Conversation
The mob's orientation was previously shifted according to the player's height, which could lead to collision and movement issues that were difficult to diagnose.
76af79f
to
14823a2
Compare
look_at_from_position()
usage in Your first 2D game tutoriallook_at_from_position()
usage in Your first 3D game tutorial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs the C# fix but the motivation makes sense and the change looks right.
// | ||
// Ignore the player's height, so that the mob's orientation is not slightly | ||
// shifted if the mob spawns while the player is jumping. | ||
Vector3 target = new Vector3(player_position.x, start_position.y, player_position.z); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vector3 target = new Vector3(player_position.x, start_position.y, player_position.z); | |
Vector3 target = new Vector3(playerPosition.X, startPosition.Y, playerPosition.Z); |
Only tested to compile the single script, didn't test the whole tutorial.
// | ||
// Ignore the player's height, so that the mob's orientation is not slightly | ||
// shifted if the mob spawns while the player is jumping. | ||
Vector3 target = new Vector3(player_position.x, start_position.y, player_position.z); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vector3 target = new Vector3(player_position.x, start_position.y, player_position.z); | |
Vector3 target = new Vector3(playerPosition.X, startPosition.Y, playerPosition.Z); |
This would supersede #8718 |
PR #8718 is simpler and would accomplish the same thing, but I'm not sure if we want to encourage the practice of modifying function parameters. |
Found another one this would supersede #7123 |
look_at_from_position()
usage in Squash the Creeps (3D) godot-demo-projects#1165.The mob's orientation was previously shifted according to the player's height, which could lead to collision and movement issues that were difficult to diagnose.