I have few planet spheres, with a big trigger called the Atmosphere as its child in each of them.
Players can hover around the space for unaffected by the planet’s gravity unless they enter a “targetPlanet”.
I wanted players that enters the Atmosphere trigger to consider the parent planet as their “targetPlanet”.
I tried doing this, but the “targetPlanet” variable did not change at all, even though there is no errors.
function OnTriggerEnter (other : Collider) {
if (other.tag == "Player") {
motionCon = other.GetComponent("Planetary_Jumper");
motionCon.targetPlanet = transform.parent;
}
}
Helps?