![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Cristian |
Hi.
I would like to do a StateMachine with GDscript but when the state is on Idle for example, does not recognize the variables from the base class.
# Base
#get the player class:
class_name PlayerSMF
onready var pl = find_parent("Player") as Player
onready var PlayerIdle = load("......").new()
...
#Derived
# How I can get the pl variable?
extend PlayerSMF
# Statemachine methods
EnterState():
ExitState():
UpdateState():
# I need to use the pl variable here
GetTransition():
# I need to use the pl variable here