Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gnoob

Pages: [1]
1
thanks that really helped!

2
I have a problem with getting the animation to play using Input.GetAxis("Horizontal").
I want the animation to play the walking animation while the user still has right or left pressed.
here is my current implementation and its not working. The animation just stops and it moves forward and will continue playing after i stop pressing the button.

void Update()
    {
        transH = Input.GetAxis("Horizontal") * Time.deltaTime * speed;
        if (transH > 0.0f)
        {
            transform.Translate(transH, 0, 0);
            anim.Play("walk_right");
            anim.animationCompleteDelegate = null;
        }
        if (transH < 0.0f)
        {
            transform.Translate(transH, 0, 0);
            anim.Play("walk_left");
            anim.animationCompleteDelegate = null;
        }
    }

please help. thanks

Pages: [1]