Search Unity

Changing the character movement of the toons in the Toon Character Pack from the asset store?

Discussion in 'Scripting' started by Foose, Jul 30, 2014.

  1. Foose

    Foose

    Joined:
    Jul 3, 2014
    Posts:
    21
    hey guys. I bought the mentioned pack from the asset store. Now I have built a character movement script on my own before I bought the pack. Now I want to edit the movement script from the pack with my own movement but I have no clue how to get it. I really need help with it.
    This is a part of my movement script:
    Code (CSharp):
    1. if (Input.GetKeyDown (KeyCode.LeftArrow) && rigidbody.isKinematic == true){
    2.             rigidbody.isKinematic = false;
    3.             rigidbody.velocity = new Vector3(0, 0, speed);
    4.             transform.rotation = Quaternion.LookRotation(rigidbody.velocity);
    5.             rigidbody.angularDrag = 1;
    6. }
    And this is the movement part of the pack's script:
    Code (CSharp):
    1.         float h = Input.GetAxis("Horizontal");              
    2.         float v = Input.GetAxis("Vertical");              
    3.         anim.SetFloat("Speed", v);                          
    4.         anim.SetFloat("Direction", h);                            
    5.         anim.speed = animSpeed;                              
    6.         currentBaseState = anim.GetCurrentAnimatorStateInfo(0);  
    7.        
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. Foose

    Foose

    Joined:
    Jul 3, 2014
    Posts:
    21
    ok got it now. Everything is working like it should. Except that it turns back to the animation state which it had on game start (idle). If I run forward the forward animation will trigger but if the char hits a collider it still is at forward animation and not idle or sth else. any idea how to set this up?