void Update() { if (platform) { // Disables the collider if the platform is being move and vice versa if (collider) { collider.enabled = !platform.GetDrag(); } foreach (BoxCollider boxCollid in GetComponentsInChildren <BoxCollider>()) { boxCollid.enabled = !platform.GetDrag(); } } }
void Update() { if (platform.GetDrag()) { gameObject.layer = 8; } else { gameObject.layer = 8; } }