- Edited
Hi everyone, lots of smart, talented people here. Thanks in advanced for your help
So, I am trying to call a variable from a base class I made. Everything looks like it's written correctly. I don't understand why I'm getting the error that it can't find the member. I'm only including up to the point where it errors the first time, because the script itself is quite long. Tried re-writing it but everything looks right. Let me know what you think
Here is the part of the first script with the error
extends Control
class_name State
signal textbox_closed
@export var enemy: Resource = null
var current_player_health = 0
var current_enemy_health = 0
var is_defending = false
func _ready():
set_health($EnemyContainer/ProgressBar, enemy.health, enemy.health)
set_health($PlayerPanel/PlayerData/ProgressBar, State.current_health, State.max_health)
$EnemyContainer/Enemy.texture = enemy.texture
current_player_health = State.current_health
current_enemy_health = enemy.health
Line 14:Cannot find member "current_health" in base "State".
Here is the State class
extends Node
var current_health = 35
var max_health = 35
var damage = 30