Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

3D buzz third person controller and mecanim control script

Discussion in 'Scripting' started by pixelquaternion, Apr 12, 2015.

  1. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi guy's,

    Just scratching my head all day with this and did a lot of search without any success!

    I have follow the step by step tutorial and since it was done prior to mecanim it was using the legacy animation system, so i was trying to make it work with the new Ethan character and it own set of animations and thing went pretty bad.

    The character controller seem to work OK but the only animation that was working was the default Idle, when pressing the move forward key the controller was indeed moving but without any walk animation and same go for the jump animation.

    So i went and look at many mecanim tutorials and was able to fiddle a bit with the animator but didn't have any luck making the Ethan animations set to load on my controller.

    So my question is : Do i have to make a new script to make these animations work and just a general pointer as how to proceed?

    I did look around and search and it doesn't seem they will ever updated their tutorial to recent unity 5 since the forum seem almost dead.

    Thank for any kind soul willing to share a bit of knowledge.

    Regards Peter
     
  2. Juice-Tin

    Juice-Tin

    Joined:
    Jul 22, 2012
    Posts:
    233
  3. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi Juice,

    I went thru all of them and i don't remember seeing something about that or it was fragmented and not straight to the point..

    The only vid that was close was the scripting for mecanim but they didn't explain clearly enough.

    Regards Peter
     
  4. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    OK i did some more test this afternoon and i finally have it to work as a separated script attach to the third person controller following this official unity training vid :


    But when i try to write the code for the jump anim and i re check 3 times my script that look identical to the one in unity official tutorial i get this compile error on line 7 : Assets/Scripts/GameScripts/ThirdPersonController/ControllerScript.cs(7,24): error CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected

    Here my very simple script :

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ControllerScript : MonoBehaviour
    5. {
    6.     Animator anim;
    7.     int jumpHash = Animator > StringToHash ("jump");
    8.  
    9.  
    10.     void Start ()
    11.     {
    12.         anim = GetComponent<Animator>();
    13.     }
    14.  
    15.  
    16.     void Update ()
    17.     {
    18.         float move =Input.GetAxis ("Vertical");
    19.         anim.SetFloat ("Speed", move);
    20.  
    21.         if(Input.GetKeyDown(KeyCode.Space))
    22.         {
    23.            anim.SetTrigger (jumpHash);
    24.         }
    25.   }
    26. }
    OK my mistake here i just made a type error and here the correction : int jumpHash = Animator.StringToHash ("jump");

    Regards Peter
     
    Last edited: Apr 12, 2015
  5. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi guy's,

    I will keep this thread updated with my progress until i have a complete solution to make the 3d buzz third person working in unity 5 and mecanim.

    When finish i will edit the tread with a complete tutorial how to do it so this question that come back often will be resolved once for all.

    Regards Peter
     
  6. eavonius

    eavonius

    Joined:
    Sep 13, 2015
    Posts:
    3
  7. Nubz

    Nubz

    Joined:
    Sep 22, 2012
    Posts:
    553
    yes
    That controller always was a utter POS.
     
  8. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi eavonius,

    Unfortunately no and we ditch the character controller because of it since other problem occur specially jittering when zooming close to the character.

    regards Peter