#Cannot call Timer on a null method

1 messages · Page 1 of 1 (latest)

potent cape
#

Hello, I am currently trying to make a 2.5d platformer engine for my project and I came across this error

#

This is not what my scene is supposed to look like

#

this is my scene

#

What I am currently trying to achieve is using a State Machine to determine if the player is walking, running or is in idle position. The player automatically stays in the IDLE state when standing still. When the player is moving in a direction, they are in the WALKING state and their walkspeed is set to 4.0. After Run_Timer countdown ends(1.0 seconds), the player is now in the RUNNING state and their walkspeed is set to 6.0. Then it is reset once the player comes to a stop.

#

Give me a ping if whoever can help can VC so I can stream it or I can send the files over, thanks!

storm plover
potent cape
storm plover
#

Right click on your Run_Timer and set it as unique name

potent cape
#

I set it as a unique name and I got this bug

storm plover
#

In your script you're doing "RunTimer" instead "Run_Timer"

#

Obviously it won't work like that

#

Right here :
onready var run_timer: Timer = %RunTimer

potent cape
#

I see. I added the _ to my variable.

storm plover
#

I though you didn't understood what i said so i repeated my self

potent cape
#

No worries. I was able to get the scene working but I am having trouble transitioning from IDLE state to WALKING state to RUNNING state

storm plover
#

🗣️ Use AnimationTree

#

Idk why you try to code an animation state machine while there is a complet amazing feature called AnimationTree with animationnodestatemachine, that reduce the work by 50%

storm plover
#

@potent cape did i help you correctly or i was a bit rude gdlament

potent cape
#

Was going to rewrite my code all because I didn’t set it unique or that simple variable 💀