Hi,
we have dynamically instantiated a Prefab airplanes (as shown in the figure below) that move across the backdrop, we would like to add a GUI Text that moves with airplane object(shown in green)
does anyone know how this can be done?
any help is really appreciated…
I am trying to do this at the moment myself. So far (only been trying for half an hour) I have had the best luck attaching a canvas to my prefab, setting the canvas to world space and changing the size of the canvas to make it easier to work with. Then attach a text UI component to the canvas and adjust accordingly and control the text via a script.
@ParityClaws approach is a valid one.
If there are many planes on the screen, the slightly more performant way of doing it is having a screenspace canvas and resolving the 3D position of the planes in to a 2D position (using the camera techniques for WorldSpacetoScreenspace), then dynamically draw / update them on the 2D canvas.
Either way will work, just your preference as to which route you go down.