moveCharacter() public method

public moveCharacter ( Vector2 inputVector ) : void
inputVector Vector2
return void
Exemplo n.º 1
0
    void FixedUpdate()
    {
        //Debug.Log(isAttachedToSurface);
        RaycastHit hit;

        if (Physics.Raycast(character.position, cameraTransform.forward, out hit, grabDistance + GetComponent <SphereCollider>().radius, surfaceMovementMask) && !isAttachedToSurface)
        {
            grappleGun.detach();
            Debug.Log("Attached to surface");
            sMovement.attachToSurface(hit);
            isAttachedToSurface = true;
        }


        Vector2 input = GetInput();

        if (isAttachedToSurface)
        {
            //sMovement.moveCharacter(input);
            if (Input.GetKey(KeyCode.Space))
            {
                Debug.Log("Detached from surface");
                isAttachedToSurface = false;
                sMovement.detachFromSurface();
            }
            else
            {
                sMovement.moveCharacter(input);
            }
        }

        doPhysics();
    }