Can't get the value out of a signal


Here, the print part gives me the actual player’s vector3(attached to a signal emitted by a timer from another scene), but if I try to print the variable anywhere outside the get_signal function it shows
How do I get that value (that changes every second) out of that function?

In the get_signal function you define a new GloPos variable that shadows the script (instance) variable GloPos.

In this case, make sure to assign the correct variable:

func get_signal(goal_position):
  GloPos = goal_position
  # ... etc

Note the omitted var keyword before the GloPos assignment.

3 Likes

oh yeah, you’re right. :smile:
thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.