Search Unity

Animator Conroller makes FPS drop under 2

Discussion in 'Animation' started by cruising, Sep 17, 2015.

  1. cruising

    cruising

    Joined:
    Nov 22, 2013
    Posts:
    329
    Hello!

    When i use any character with a animator controller like the Unity standard controller i have good FPS.
    But when i use a animator controller that comes with a other character the FPS drops to 1-2.

    It doesnt matter what character i use, still the FPS drops to 1-2 if i dont use Unitys standard animator controller. I cant even move the character!

    If i then uncheck "ThirdPersonUserController" while have the laggy animator controller the FPS is back.

    See for your self here, as soon i change to "ThirdPersonAnimatorController" the FPS is back again.

    What causing this?

     
    Last edited: Sep 17, 2015
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Are there any errors or warnings in the Console view? Maybe your other animator controller doesn't use the same parameter names as in your control script.
     
  3. BornGodsGame

    BornGodsGame

    Joined:
    Jun 28, 2014
    Posts:
    587
    For better help, you should open the animator controller and show us that. My guess is that there is some event attached to one of your animations that is firing repeatedly. What is the default animation for the controller, just an idle animation? Open up the animator controller, then click on the default animation ( the orange one) and then check the inspector to see what is going on with that animation.
     
  4. cruising

    cruising

    Joined:
    Nov 22, 2013
    Posts:
    329
    Yes i getting warnings about these, it says it doesnt exist +999 times in ThirdPersonCharacter. i guess thats the problem?
    Code (CSharp):
    1.             m_Animator.SetFloat("Forward", m_ForwardAmount, 0.1f, Time.deltaTime);
    2.             m_Animator.SetFloat("Turn", m_TurnAmount, 0.1f, Time.deltaTime);
    3.             m_Animator.SetBool("Crouch", m_Crouching);
    4.             m_Animator.SetBool("OnGround", m_IsGrounded)
     
  5. cruising

    cruising

    Joined:
    Nov 22, 2013
    Posts:
    329
    Here is the animator controller, its a big one


    And here is the when i just klick on the Idle animation (orange)


    And the last one when double klick


    And when i uncheck "ThirdPersonUserController" it stops to drop the FPS, so it might be that script that is the issue?
     
    Last edited: Sep 23, 2015
  6. BornGodsGame

    BornGodsGame

    Joined:
    Jun 28, 2014
    Posts:
    587
    Yeah, it definitely is what Tony said and not what I was thinking. The parameters in your scripts are what is causing the issue. What I mentioned could have caused problems, but after seeing your error messages it is definitely the script looking for parameter
     
  7. cruising

    cruising

    Joined:
    Nov 22, 2013
    Posts:
    329
    How do i find out what parameters i should use?
     
  8. BornGodsGame

    BornGodsGame

    Joined:
    Jun 28, 2014
    Posts:
    587
    the parameters will be listed on the white lines that connect two states. For instance, between ´Idle´ and ´1h_tookweaponout´ there is a white line with a small white arrow, click on the arrow and it will pull up the transition that shows what parameter is used to control that transitions. You are going to have to go through every transition and set the parameter somewhere in your scripting.

    At the same time, you are also going to have to remove references to parameters in your current scripts that point to parameters that do not exist in your animator controller. (which is what is causing the FPS issues).

    It is not easy to Frankenstein a character control system with an animator controller that wasn´t built from scratch to be used with it. You are going to have to do a lot of dirty legwork to fix it. You are probably much better off just using the control scripts that came with the animator controller and modify them to fit your needs. (IMHO) or start from scratch with your scripts using the parameters from the animator controller.
     
    theANMATOR2b likes this.