Godot Version 4.3 (latest)
I’m having an issue with following a tutorial, a bit embarrassing I admit. I am following the Godot 4 intermediate Card Game Course and I am having an issue with the card_base_state.gd. Essentially is looking to have the label revert to say “BASE” with a color change vs the actual sprite’s label and color - I think. I have copied everything across from the little training program from scratch very slowly would anyone know if this is a version issue? Or am I just blind?
card_state.gd set as below:
class_name CardState
extends Nodeenum State {BASE, CLICKED, DRAGGING, AIMING, RELEASED}
signal transition_requested(from: CardState, to: State)
@export var state: State
var card_ui: CardUI
func enter() → void:
passfunc exit() → void:
passfunc on_input(_event: InputEvent) → void:
passfunc on_gui_input(_event: InputEvent) → void:
passfunc on_mouse_entered() → void:
passfunc on_mouse_exited() → void:
pass
Following this I have the card_base_state.gd as
extends CardState
func enter() → void:
if not card_ui.is_node_ready():
await card_ui.ready
card_ui.reparent_requested.emit(card_ui)
card_ui.color.color = Color.WEB_GREEN
card_ui.state.text = “BASE”
card_ui.pipvot_offset = Vector2.ZEROfunc on_gui_input(event: InputEvent) → void:
if event.is_action_pressed(“left_mouse”):
card_ui.pivot_offset = card_ui.get_global_mouse_position() - card_ui.global_position
transition_requested.emit(self, CardState.State.CLICKED)
Thanks just for spending the time on the read.