private void OnPhysicsCollisionExit(PhysicsCollider other) { if (PlayerOn && other.GetComponent <PlayerMovement>()) { Debug.Log("Player leaving planet"); PlayerOn = null; } }
void OnPhysicsCollisionEnter(PhysicsCollider other) { if (other.CompareTag("Terrain")) //hit planet { if (onPlanet == null) { Debug.Log("Hit planet"); physics.attractionActive = false; physics.Stop(); onPlanet = other.GetComponent <Planet>(); } else //squished between planets //TODO: kill player (probably a different script tho) { } } }
private void OnPhysicsCollisionEnter(PhysicsCollider other) { Debug.Log("Player entering planet"); PlayerOn = other.GetComponent <PlayerMovement>(); }