Compile error in code in Unity [duplicate]

-6

Thisislike

usingUnityEngine;publicclassPlayerMovement:MonoBehaviour{voidAwack(){floorMask=LayerMask.GetMask("Floor");

            anim = getComponet <Animator> ();
            playerRigidbody = GetComponent <Rigidbody> ();
    }

    void FixedUpdate ()
    {

        float h = Input.GetAxisRaw ("horizontal");
        float v = Input.GetAxisRaw ("vertical");

        Move (h, v);
        Turning ();
        animating (h, v);
    }
     void (float h, float v)
        {
                movement.Ser(h,0f,v);

                movement = movement.normalized * speed * Time.deltatime;

                playerRigidbody.MoviPosition (transform.position + movement);
        }
    void Turnig ()
    {
                Ray camRay = Camera.main.screenPointToRay(Input.mousePosition);

                RaycastHit floorHit;

        if(Physics.Raycast(camRay,out floorHit.camRayLenght.floorMask))
        {
            Vector3 playerToMouse = floorHit.point - transform.position;
            playerToMouse.y = 0f;

            Quaternion newrotation = Quaternion.LookRotation(playerToMouse);
            playerRigidbody.MoveRotation(newrotation);

        }


    }


    void animating(float h,float v)

    {
        bool walking = h != 0f.v!=0f;

        anim.SetBool("IsWalking",walking);





    }

}
    
asked by anonymous 04.09.2015 / 20:35

1 answer

2

It's hard to help with just this but one thing that's wrong for sure is this: bool walking = h != 0f.v!=0f; . This specific problem probably resolves like this:

void animating(float h, float v) {
    anim.SetBool("IsWalking", h != 0f || v != 0f);
}

The code is poorly organized and makes reading difficult.

    
04.09.2015 / 20:44