public void OnContinue()
    {
        //ropeScript.UnhookRope();
        throwHook.UnhookHook();
        GameObject closest = GetClosestGrabbableWithoutRadius();

        transform.position = new Vector3(closest.transform.position.x, closest.transform.position.y, transform.position.z);
        rb.velocity        = new Vector2(1f, 1f) * 10f;
    }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     if (activateRocket)
     {
         transform.Translate(Vector3.right * Time.deltaTime * rocketSpeed);
         player.transform.position = transform.position + Vector3.up;
         throwHook.UnhookHook();
         //PM.SetPlayerState(States.STATE_ROCKET);
         if (Vector3.Distance(initialPos, transform.position) > maxDistance)
         {
             ReachedDistination();
         }
     }
     else if (useSpeed)
     {
         transform.Translate(Vector3.right * speed * Time.deltaTime);
     }
 }