Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Adding an animation controller changes my script values (editor bug?)

Discussion in 'Editor & General Support' started by baardie1, Aug 24, 2023.

  1. baardie1

    baardie1

    Joined:
    Jul 30, 2016
    Posts:
    6
    So, I have an item with a script called "Weapon" - all it does is when fire1 is used and we can attack (simple deltatime count).

    But, I have noticed when I add my animation controller it simply breaks the script and adds these random values.. What exactly is going on here? The animation controller simply holds 1 animation (the attack) and 1 bool.

    It's supposed to be 12, 1, 1 but as soon as the animation controller is added it changes to 25, 1, 1 and the script can't count down anymore.

    See video below! (expires, will re-upload if it does).



    I can only assume it's an editor bug since I've never seen this occur before - super odd.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,503
    It's not a bug, it's by design. I assume the controller has at least one animation that has at least one keyframe for that value.
     
    baardie1 likes this.
  3. baardie1

    baardie1

    Joined:
    Jul 30, 2016
    Posts:
    6
    Interesting, never spotted that before and wasn't even aware I had set anything during the animation - thanks!