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.