Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Fusegene Studios |
extends Node
var number = 6
const boy = 5
func _ready():
if Input. is_action_pressed(up):
if number = 5 or boy = 5
print(var = 9)
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Fusegene Studios |
extends Node
var number = 6
const boy = 5
func _ready():
if Input. is_action_pressed(up):
if number = 5 or boy = 5
print(var = 9)
Reply From: | Gluon |
There are a few problems above, you have no : at the end of an if statement, you have no quotations on the is action pressed and you should be getting an error message saying unexpected assign. If you use one equals it means assign this to the variable if you want to ask if something is equal to a thing you need two equals signs like this
var number = 6
const boy = 5
func ready():
if input.is_action_pressed("up"):
if number == 5 or boy == 5:
print("9")
Reply From: | Mazen |
the is_action_pressed method is written like this and u should pass a string argument to it meaning u should rite “up” not up