|
@ -156,6 +156,10 @@ public class magnetGun : MonoBehaviour { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item.tag == "moveable"){ |
|
|
if (item.tag == "moveable"){ |
|
|
|
|
|
|
|
|
|
|
|
playerController.animator.SetBool("Holding",true); |
|
|
|
|
|
//playerController.animator.SetTrigger("startHolding");
|
|
|
|
|
|
|
|
|
originalConstrants = item.attachedRigidbody.constraints; |
|
|
originalConstrants = item.attachedRigidbody.constraints; |
|
|
originalGravity = item.attachedRigidbody.useGravity; |
|
|
originalGravity = item.attachedRigidbody.useGravity; |
|
|
|
|
|
|
|
@ -212,6 +216,8 @@ public class magnetGun : MonoBehaviour { |
|
|
|
|
|
|
|
|
private void dropItem(Collider item){ |
|
|
private void dropItem(Collider item){ |
|
|
if (item != null) { |
|
|
if (item != null) { |
|
|
|
|
|
playerController.animator.SetBool("Holding",false); |
|
|
|
|
|
|
|
|
item.attachedRigidbody.useGravity = originalGravity; |
|
|
item.attachedRigidbody.useGravity = originalGravity; |
|
|
item.attachedRigidbody.drag = 0.0f; |
|
|
item.attachedRigidbody.drag = 0.0f; |
|
|
item.attachedRigidbody.constraints = originalConstrants; |
|
|
item.attachedRigidbody.constraints = originalConstrants; |
|
|