0 votes

Okay so after instancing a scene and adding it to the game, i want to set its position to be at the mouse position. My code:

var objectScene = load("res://scenes/object.tscn")
var object = objectScene.instance()
call_deferred("add_child", object)

This code is attached to a simple Node.
I want to set the position of the instanced scene through code... also, how i can get its name?

in Engine by (402 points)
edited by

Is this 2D or 3D?

okay, solved this... it was 2D

How did you solve it?

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.
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 webmaster@godotengine.org with your username.