ui_accept not working

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

I have this issue where when I load my game and press space to use the command for ui_accept it crashes and reads "Nonexistent function ‘instance’ in ‘base bool’
I’m new to this coding thing so please explain it in simple terms.
Heres the code
if Input.is_action_pressed(“ui_accept”):
if recharge_timer <= 0:
var Missile = Missile.instance()
Missile.position = position
Missile.rotation = rotation
recharge_timer = recharge_time

When posting code, or use `code` for short terms to get this result or paste your code and click on the code icon, near the image icon, to format it, or it’s going to be harder to read and you will lose all the “_” on the code. Also, watch out your tags, you posted it as C# scripting. Tags are not mandatory but if you are going to use them, try to use correctly.

Please add a comment with the formatted code so the community can try to help you.

fpicoral | 2019-01-22 00:57

And about your problem, the Missile is not a scene. Where are you defining it? Are you using preload("res://path") or load("res://path")?

fpicoral | 2019-01-22 01:00

Im using preload

Fire | 2019-01-24 01:30

Could you share the project? It’s not possible to help you with this amount of information. If you do so, please inform with version of Godot you are using.

fpicoral | 2019-01-24 02:25