Browse Source

+pointing rod when picking up object

master
Joshua Reason 9 years ago
parent
commit
9f153ce981
2 changed files with 6 additions and 0 deletions
  1. BIN
      unity_Project/Assets/Character/Character_Animation.controller
  2. +6
    -0
      unity_Project/Assets/Scripts/magnetGun.cs

BIN
unity_Project/Assets/Character/Character_Animation.controller View File


+ 6
- 0
unity_Project/Assets/Scripts/magnetGun.cs View File

@ -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;

Loading…
Cancel
Save