void Update() { UnityInputMovement(); if (Input.GetButtonDown("Pickup")) { if (pickedUp != null) { if (touching != null) { touching.AddItem(pickedUp); } else { pickedUp.Drop(); } pickedUp = null; } else if (touching != null) { pickedUp = touching.Take(); if (pickedUp != null) { pickedUp.Attach(hand); } } } if (touching != null) { GrapePress grapePress = touching.GetComponent <GrapePress>(); if (grapePress != null) { grapePress.Operate(Input.GetButton("Action")); } Barrel barrel = touching.GetComponent <Barrel>(); if (barrel != null) { barrel.Operate(Input.GetButton("Action")); } } }