Is_on_floor() is not working

Godot Version

4.2.2

Question

I’m making a 2d side-scrolling game and I’m currently making CharacterStateMachine but in my AirState I get this error “Cannot call non-static function “is_on_floor()” on the class “CharacterBody2D” directly. Make an instance instead.”
this is my AirState script


this is my CharacterStateMachine script

please help me
(My english is not that good,Sorry)

Make sure your character is assigned in the inspector, looks like it might have previously been saved as

= CharacterBody2D instead of using the colon to declare a type : CharacterBody2D.

1 Like

Thank for the help.
Sorry I didn’t reply for so long,I have to stop my project for a while but now I’m back to work on it.