Hello… I’m a noob, please be gentle.
I have a car, with a set of colliders in it (because the car isn’t a uniform shape) - these colliders are called “body1” to “body4”
now, i want to have a variable in the car which is “checkpoint” location, when the car passes through a trigger box, the trigger box passes it’s position data to the car and populates the cars “checkpoint” location…
the only problem is i can’t access variables in the main cars script…
checkpoint boxes script… sends a “checkpoint” message to the car…
function OnTriggerEnter (other : Collider) {
other.gameObject.SendMessage ("checkpoint", SendMessageOptions.DontRequireReceiver);
}
But unfortunately, it sends it to the colliders… not the parent object… (so if I create a function “checkpoint” and put it in the body1 collider it works, (but then I don’t know how to pass this data to the parent script))
i really want to do this:
other.gameObject.parent.SendMessage - but that causes an error…