Godot Version
Godot 4.2
Question
Hello, i was programming the statemachine for character in 2d platform fighting game but godot 4 detected an error which said “Identifier ‘state’ not declared in the current scope”, I don’t know what that means and I don’t even know what to do? or it’s because of my phone which im using to create the game or this update have some meltfuctions, here the script i wrote:
extends Node
@export var Id = 1
func _ready():
pass
func state_logic(delta):
pass
func get_transition(delta):
pass
func enter_state(new_state, old_state):
pass
func exit_state(old_state, new_state):
pass
func state_includes(state_array):
for each_state in state_array:
if state == each_state:
return true
return false
And here the problem:
if state == each_state:
If you know what that means, tell me how do I declare