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. Dismiss Notice

animator.SetFloat dampTime

Discussion in 'Scripting' started by SentientSkull, Nov 5, 2017.

  1. SentientSkull

    SentientSkull

    Joined:
    Apr 26, 2013
    Posts:
    75
    How do you use the 'dampTime' version of 'animator.SetFloat()'? It appears that you have to calculate some value(s) across updates for it to work correctly. In a method called from 'Update()', I use:

    anim.SetFloat("MoveZ", moveZ, .1f, Time.deltaTime)

    but it will never reach the actual value of the input. So if the input value is 1, the dampened value only ever reaches .7.

    Can someone show an example of how to set this up properly? I've seen some partial examples, but they use values/variables that aren't defined in the example, so I can't see how it is supposed to work.
     
  2. ImperativeGames

    ImperativeGames

    Joined:
    Dec 11, 2016
    Posts:
    34
    dodipsitorus likes this.