This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

Hi guys I have a small problem, I am trying to instantiate a missile from several Position2D objects that I have placed around a platform. The problem is that when I instantiate a missile and then add it with the addchild() method as a child of a Position2D it instantiates it somewhere else! Can anyone tell me why or can you help me figure out where I'm going wrong?

Godot version 3.2.3
in Engine by (54 points)

is your missile scene positioned at Vector2.Zero? and not somewhere else? Check the transform. Or after instantiate you could set the spawn position:

add_child(missile_instance)
missile_instance.transform.origin = spawn_position

Putting the transform of the missile at coordinates(0,0) worked. Now it instantiates the missile. Thanks

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 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.