I am a beginner in Unity and not really familiar with lots of things and currently making a game for our project. I searched a lot on how to interact with objects but they all have different way to do it so I can't understand what is the best way to implement interactions in the scene.
What I want to do is like when my character come to a table with a newspaper in it, there will be bubble pop up to that says "view" or "read" then 2D assets will pop-up to read the content of the newspaper. What is the best way or maybe the easiest way to do these events?
The game I am creating is a 3d Isometric Perspective game if this helps.
CodePudding user response:
- Add GameObject around the table.
- Add box collider to the GameObject.
- set false to isTrigger option.
- This Collision can handle event when the character comes to around the table.
- Create Script and add to the GameObject.
GameObject popup; private void OnTriggerEnter(Collider other) { if(other.tag == "character") { popup.SetActive(true); } } void OnTriggerExit(Collider other) { if(other.tag == "character") { popup.SetActive(false); } }