Beispiel #1
0
 //disables gravity and ignores collision with the player to prevent you from being shot into space
 public override void OnGrab()
 {
     print("grab");
     isGrabbed = true;
     GrabMgr.AddGrabbed(this.gameObject);
     this.GetComponent <BallRespawner>().SetHolding(true);
     Physics.IgnoreCollision(this.GetComponent <SphereCollider>(), player.GetComponent <CapsuleCollider>(), true);
     this.GetComponent <Attractable>().setAttractable(false);
     CheckActiveHand();
 }
Beispiel #2
0
    public override void OnGrab()
    {
        if (snapZone.GetSnapped() == true && this.gameObject == snapZone.getSnappedObject())                  //makes sure to re-enable gravity and physics
        {
            snapZone.UnsnapObject();
        }

        print("grab");
        isGrabbed = true;
        //this.transform.parent = player.gameObject.transform;
        //this.transform.localScale = originalSize;  //puts back to normal size seed
        GrabMgr.AddGrabbed(this.gameObject);
        Physics.IgnoreCollision(this.GetComponent <BoxCollider>(), player.GetComponent <CapsuleCollider>(), true);
        this.GetComponent <Attractable>().setAttractable(false);
    }