- Home /
Identifying which prefab which you triggered.
Say i have multiple pickup-able objects in my world that are the same prefab.. How do i go about checking if its only the object im colliding with that does what i want it to instead of the other prefab?
As a demonstration:
Answer by logicandchaos · Apr 27, 2020 at 03:31 PM
You need to show your code, are you not using collisions? Like usually people setup a collision in code and it gets the collider of the object that it hit.. then you get the gameObject from the collider. Or you have the collision code on your object so that you can just use gameObject, transform or this..
Your answer
Follow this Question
Related Questions
Trigger help! 0 Answers
Script works for NPCs, but not Player 1 Answer
Jumpscare (Triggers and stuff) 1 Answer
Repeat While Object in Range 1 Answer
Not able to set explosion.SetActive(true) on player destroy 1 Answer