Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | scooty |
Hey, I’m trying to get my script to print the player’s position each time it clicks but it just keeps printing the same initial position
onready var PlayerMan = get_parent().get_node("Player").position
func _input(event):
if event.is_action_pressed('Fire'):
PlayerMan = get_parent().get_node("Player").position
target_position = PlayerMan
print(target_position)
Are you changing the Player.position
in your Player
’s script?
All you’re doing is printing the Player
node’s position
in that code excerpt, if Player.position
is not updated elsewhere, it’s working as written.
timothybrentwood | 2021-05-05 01:09