How to pinpoint the gameobject?

Hello fellas, I’m currently developing an isometric game in Unity 3D, and I’m looking for advice on implementing a highlighting and pinpoint selection system for my GameObjects.

In my game, certain GameObjects need to be highlighted to draw the player’s attention. Once highlighted, the player should be able to click on a pinpoint circle image button to select the highlighted GameObject and trigger specific actions associated with it.

Could someone provide guidance or point me towards resources or tutorials that demonstrate how to achieve highlighting and pinpoint selection for GameObjects in an isometric Unity 3D game with click interaction? I am very beginner level so, any help or insights would be highly appreciated.

Here is my imagination:

1 Answer

1

Hi, you could use Raycasting from the Camera view when clicking. When the ray hit your GameObject, you get his instance, from it you can call a function from a script attached to him (the GameObject).

This function will set active the indicator upon him (set inactive by default), becoming visible and interactable. The same method can be then applied to this indicator (that is an image of a button) to trigger a new action from his script.

This is an example, maybe a better solution can be found, anyway raycasting is necessary.

Thanks for your suggestion! I've got raycasting working for click detection. Now, I'm trying to figure out the best approach for implementing the pinpoint to the selected GameObject. Regarding the pinpoint, I'm thinking of using a World Space canvas with a round button to represent it? Like https://www.youtube.com/watch?v=GuWEXBeHEy8. And, for the line between the round button and the selected cube GameObject, would it be appropriate to use a Line Renderer or another method? I glad to hearing your thoughts or any alternative solutions for achieving this.

You can use LookAt() function for rotating your button towards your camera. Method you shared should works. For the line, the line renderer is certainly a good solution, I guess. Else you could use a 3D plane or cube and streching it to make it looks like a line, then apply a material and shadows settings to erase the 3D aspect. But I think the built-in line renderer should be way more appropriate.

Okey, i will try it and report back. Thanks!