- Home /
The question is answered, right answer was accepted
On Method for a collider on another object.
Hi guys, I've just been wondering if I can call an On method (such as OnTriggerExit) on a script attached to another object? I'd just like to know if I'm wasting my time or not. In my case I have 2 walls sharing a script, and a ball jumping off of them. I wanna make the one that is jumped off of, be disabled (and the opposite one enabled). So is this legit?
public Bouncer jumper;
void OnTriggerExit2D (Collider2D other)
{
if (other == jumper.trig) // this is the trigger collider attached to the player object.
{
Answer by meat5000 · Aug 06, 2014 at 12:45 PM
Check my answer on that page for a Hacktastic method. :)
Follow this Question
Related Questions
Destory/Collect object to open door 1 Answer
Trigger help! 0 Answers
Adding force relative to the distance from an object 1 Answer
Check if trigger is occupied 1 Answer
Problems when i have multiple enemies on the same scene C# 1 Answer