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

Change speed parameter of a specific Animator State by using script. HOW?!

Discussion in 'Scripting' started by stphovig, Apr 30, 2020.

  1. stphovig

    stphovig

    Joined:
    Apr 30, 2020
    Posts:
    2
    I'm in desperate need of assistance. I would be so grateful if someone would help me out.

    I would like to set up a script that will create a random speed for the speed variable of only one State within the animator.

    I've been trying for over 15 hours and still haven't got anywhere near a solution.

    My main concern is how to change the speed variable of just one State within the animator by script. I think i'll be able to figure out how to create a randomiser to go with that.
     
  2. sbalanoff

    sbalanoff

    Joined:
    Nov 14, 2019
    Posts:
    36
  3. stphovig

    stphovig

    Joined:
    Apr 30, 2020
    Posts:
    2
    thanks for the fast reply :)

    I'm quitte new to all this. Just have been binchwatching tutorials like crazy.
    But still can't figure this out.
    Must have tried hundreds of variations, except the right one ...

    Can you tell me why this doesn't work. I thougt this should atleast set the speed to 0.2.
     

    Attached Files: