Thanks curb47 & djaydino for sharing. I'll take note in future. I need more time to digest what you say
I'm actually in the middle of youtube tutorial in making 3D horror game. But sometimes he kept changing the method, which make me super confused. So I'd like to create my own version for some parts. BTW, do Spherecase, get raycast, get/ set tag, conditional expression are heavy resources too? He uses a lot of this.
For the "inspecting item" function I mention previously, could you advice how I can do it? I want to make a logic like below:
1. Is player looking at the object? => use spherecast
2. If yes, check if the object tag is "door".
3. If yes, activate "text" gameobject & set the text with "UI Text set text"
4. When the UI text appear, player can get key down to make interaction
5. The interaction will show animation e.g. door opening or door closing
6. The current state of the door will determine what animation it will play. e.g. if currently door is closed, it will play door opening animation, vice versa
For no 1, 2 & 3 I can get the answer by following the tutorial. But I don't know how to know which animation / door state currently is so that the animation can play accordingly when I click a button.