- Home /
Acces to other object trigger thru other object script
i want to use the function on trigger stay and exit but not the transform....i want to get acces to 4 diferents objects with trigger....because i dont want to do 4 script for each trigger...is it possible..
What?! Can you elaborate? I don't understand what you want to do...
supose that: i have a gameobject call supose that: i have a gameobject call box and an other one called circle
i attach a script to the circle and that script says if something trigger enter in the trigger of the box....the game is over..
It would be easiest to just attach the same script to all 4 objects. You don't have to make 4 separate scripts for that though.
i think he is saying he wants one object "circle" to know when another object "box" has its OnTriggerEnter function called.
You could search the scene for "circle" during the boxes "OnTriggerEnter" and get that object and act on it. That sounds like you might be going about this the wrong way though.
You need to say what you'd like to do because i'm betting there is an easier way than the method you have in your head to do what your trying to do.
if you want to end the game when something enters the box attach a game end script to the box. make it a prefab and spawn 1000 copies of the box prefab, enter any one of those 1000 copies and you will end the game.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
My script doesnt respond what i wrote HELP!!! 0 Answers
platforme ...HELP!! POSITION ADDING 1 Answer
Spawning objects help 2 Answers