–1 vote

I have this issue where when I load my game and press space to use the command for uiaccept 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
actionpressed("uiaccept"):
if rechargetimer <= 0:
var Missile = Missile.instance()
Missile.position = position
Missile.rotation = rotation
Missile.linear
velocity=linearvelocity+Vector2(Missilespeed,0).rotated(rotation)
getparent().addchild(Missile)
rechargetimer = rechargetime

asked Jan 21 in Projects by Fire (13 points)

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.

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")?

Im using preload
thanks

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.

Please log in or register to answer this question.

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 How to use this Q&A? before posting your first questions.