Hello!
I wanted to ask for help setting a system, where the player would come close to certain objects and the name of those objects would pop up in 3D space (a very common thing in rpg/quest games).
I am able to do that by setting a sphere collider on the object, making a TextMesh pro layer, deactivating it and setting the trigger that when a player hits the collider it activates the Text layer.
It seems alright, but I’ll have quite a few objects with different names and I feel this is not the way to go. I’ve tried setting a global FSM with “get Distance” or similair actions, but I can’t wrap my head around how to calculate distance every frame to just certain objects and show the text only to those which are near the player. I thought maybe tags would help, but could not find a way how to convert tags to variables.
Also I've tried creating empty game object, adding a sphere trigger and parenting it to the Player and making FSM on this trigger, but I don't understand why it does not work and the "on trigger enter" action does not activate when it collides with the object. I checked all the tags and objects multiple times. If I set up it the other way arround (having the trigger on the object) it works...
Maybe anyone would have any thoughts on this?