![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | MushroomAlien |
I am a complete beginner, and I am having trouble with a tutorial I am working through.
I have a scrip with the following variable definition:
export(int) onready var health = max_health setget set_health
It shows up in the editor’s inspector as expected. However, when I change the value in the inspector, save the scene, and run my game, the value I changed is ignored, and the original value is used in the game.
Here is the whole script for context:
extends Node
export(int) onready var max_health = 4
export(int) onready var health = max_health setget set_health
signal no_health
func set_health(value):
health = value
if health <= 0:
emit_signal("no_health")