|
|
|
 |
Attention |
Topic was automatically imported from the old Question2Answer platform. |
 |
Asked By |
9BitStrider |
I’m wanting to display the “state” variable from player.gd using “world.gd.”
Heirarchy:
world
-----player
The script I’m using is as follows:
$debug/state.set_text(str($player.state))
This returns a null instance error, though. Is there another function to pull that information?
|
|
|
 |
Reply From: |
Ole |
In your player.gd:
var state:float = 1.0 setget , get_state
func get_state() -> float:
return state;
In world.gd:
$debug/state.set_text(str($player.get_state()))
|
|
|
 |
Reply From: |
9BitStrider |
Another example that you should double check your code before spazzing out. Haha. I missed the 1 in debug. Now it works.