Target name on canvas

(Mordor) #1

Hi, I have a question.

I know how to get the name of the target in the text on a canvas, but how to change the position of the text so the text was over the target.How to translate the position of the target object from the world of 2D canvas?

(Mordor) #2

This function is implemented in the game “Gothic 2”

There names are displayed above the objects

(Mordor) #3

I heard about the worldtoscreenpoint function ,but how it can be used with Plygame?

(Alien) #4

create a UI canvas and set the worldspace settings. Place it under the avatar/player or monster.

(Mordor) #5

I’ve come up with .I think my solution is more optimized because I’m using only one prefab text for all objects(npc,items,interact object).
Tomorrow I’ll show the screenshots of bloxs my solutions.

(Mordor) #6

Here are screenshots of blox event,it works.

This event in On Update In the player
Object “TextNNN” is the text in worldspace canvas (I reduced the canvas size to 0.01 so that the text can be seen)

This event in on actor makes selection in the Player