- Home /
Animator Condition not working correctly!
Hello :) ,
im struggling with a problem: I have my character with the body, and an Aniamtor for the body. I have a animator parameter called MovementState (int). So i want that if MovementState Equals 0 it plays the idle animation, if MovementState is 1 it plays the walk anim and if MovementState is 2 i plays the run anim. Thats working correctly with idle and walking but it just wont player the run animation :( I dont know whats wrong.
Heres my animator: http://prntscr.com/hpmhh9
Heres my animation script wich set the int MovementState:
   if (controller.velocity.magnitude > 0.3f && grounded)
              {
                  RaycastHit hit;
                  if (Physics.Raycast(transform.position, Vector3.down, out hit, 1.5f))
                  {
                      switch (hit.transform.tag)
                      {
                          case "Soil":
                              RequestFootstep(dirtWalk);
                              break;
                          case "Stone":
                              RequestFootstep(stoneWalk);
                              break;
                          case "Snow":
                              RequestFootstep(snowWalk);
                              break;
                          case "Wood":
                              RequestFootstep(woodWalk);
                              break;
                      }
  
                      if (!footstepsAudioSource.isPlaying)
                          footstepsAudioSource.Play();
                  }
  
                  if (running)
                      firstPersonBody.SetInteger("MovementState", 2);
                  if (crouching)
                      firstPersonBody.SetInteger("MovementState", 3);
                  else
                      firstPersonBody.SetInteger("MovementState", 1);
              }
  
              else
              {
                  footstepsAudioSource.Pause();
                  firstPersonBody.SetInteger("MovementState", 0);
              }
Best Regards,
K
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                