-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix look_at_from_position() usage in Squash the Creeps (3D)
#1165
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 Squash the Creeps (3D)
#1165
Conversation
a161156 to
89ba3f6
Compare
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.
89ba3f6 to
f08df2b
Compare
|
In my modest opinion, as a user and someone with a very small (for now) background on programming, I'd like to propose a change. The following changed code func initialize(start_position, player_position):
# Ignore the player's height, so that the mob's orientation is not slightly
# shifted if the mob spawns while the player is jumping.
var target = Vector3(player_position.x, start_position.y, player_position.z)
look_at_from_position(start_position, target, Vector3.UP)could be just func initialize(start_position, player_position):
# Ignore the player's height, so that the mob's orientation is not slightly
# shifted if the mob spawns while the player is jumping.
# start_position.y could also be written as 0.0
player_position = Vector3(player_position.x, start_position.y, player_position.z)
look_at_from_position(start_position, player_position, Vector3.UP)
|
|
Needs a rebase. @gabriele2000 Modifying function parameters is considered a bad practice by some, so I wouldn't encourage it in official demos, even though it would work fine either way and potentially use ever-so-slightly less memory. |
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.
I resolved the conflicts, this is good to go!
look_at_from_position()usage in Your first 3D game tutorial godot-docs#10666.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.