Assignment is not allowed inside an expression how to fix

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AriDavNath

hi so i have a problem where i cant do an equal sign in an if statement for example

var print = 1

func _physics_process(delta):
if print = 1:
print(“problem”)

can anyone help?

:bust_in_silhouette: Reply From: jgodfrey

This code…

if print = 1:

Should be this:

if print == 1:

Note the double ==