+1 vote

In my game you are a spaceship and you have to avoid meteorites. the meteorites should be placed in a certain place.
here is the script:

var myNode = preload("res://myNode.tscn")

func add_myNode_to_Game(): 
     var myNode_instance =  myNode .instance() 
     get_tree().get_root().add_child(myNode_instance)

    myNode_instance.global_transform = global_transform
Godot version v3.2.3
in Engine by (18 points)
edited by

What's the problem here? You need to be more specific. What do you want to do and what's not working.

I want to add the meteorites to a certain position at the top of the screen (it should be a mobile game) and I need to know how to add in this script where I can import the node.

1 Answer

0 votes

You have a spelling error on line 4: myNoder_instance should be myNode_instance. Also, I don't recommend that you mix snake case and camel case like that.

by (7,927 points)
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.