0 votes

I am attaching a 2D-label to a 3D-MeshInstance using script as follow:

extends MeshInstance

func _process(delta):
    var pos = get_translation();
    var screen_pos = get_parent().get_node("Camera").unproject_position(pos);
    $TextureRect.set_position(Vector2(screen_pos.x+20, screen_pos.y-120));

Now I want to generate many of this object, so I try to use a scene to contain it.

But Now my problem is how can I acces to unproject_position in the main scene?

I am a learner now so please forgive me if I am asking a stupid question, but I really want to get some help. Thanks.

in Engine by (19 points)

what does your scenetree look like?

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.