0 votes
func _on_MegaMan_finished():
if anim == "lilstep" and direction <> 0:
    anim = "run"
    player.play(anim)

The above code gives me the following error:

error(71,38): Error parsing expression, misplaced: '>'

I'm not too familiar with the inner workings with GDscript or Python yet. Is there another expression to tell if my direction value is different from 0?

in Engine by (236 points)

1 Answer

0 votes

Figured it out. I needed to use != instead of <>. Curse me for going with Clickteam Fusion for all this time. XD

by (236 points)

Using != works reliably for strings or integer values.

It does not work reliably for floating point values. In that case you could use something like: if abs(float1-float2)<0.0001:

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.