Quantcast
Viewing latest article 20
Browse Latest Browse All 95

GameObject is already being activated or deactivated

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?

Viewing latest article 20
Browse Latest Browse All 95

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>