Hi all,
I´m having a little problem with my current development process..
When my player dies, the gameObject is deactivated.
So far so good.
In my game I have moving platforms with a parenting code like this, to make him move with the platform.
void OnCollisionExit2D(Collision2D other)
{
if (other.transform.tag == "MovingPlatform")
{
transform.parent = null;
onPlatform = false;
}
}
}
The problem is:
If my player dies, while still being "part" of the moving platform, I receive the error in the title.
What could I do to prevent this?
↧