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

Resolved Switching animations of a single dormant object

Discussion in 'Animation' started by Josiah_Ironclad, Sep 4, 2022.

  1. Josiah_Ironclad

    Josiah_Ironclad

    Joined:
    Sep 24, 2019
    Posts:
    156
    I've been at this for like 2 hour, searching, trial-and-error'ing. I cannot figure out how this is meant to work.

    I have:
    1 GameObject, 2 Sprites (sword, shovel), 2 Animations (each using the appropriate sprite).

    The GameObject's sprite is changed based on what item is equipped (with number keys 1 and 2). When I press LMB, I set animator parameters to trigger the appropriate transition. But I have absolutely no clue how to actually do the nodes in the controller. I tried "Any State" node transitioning into both animation nodes, I tried the same with the "Entry" node. And I don't think making every animation transitioning into every other one would be a good idea. I tried playing around with each transition's settings, turning exit time on/off, setting fixed duration, etc.

    I just need the animator to not do anything pretty much, until I press LMB, and then run the correct animation. Any time I worked with characters, I'd just have the Entry node transition into an idle animation even if that was just a single solid frame, but that won't work here since I can't be sitting on an idle sword animation when I have a shovel equipped, and vice versa.
     
    Last edited: Sep 4, 2022
  2. Josiah_Ironclad

    Josiah_Ironclad

    Joined:
    Sep 24, 2019
    Posts:
    156
    Omg, I got it working!!!
    I feel like such a freaking moron! I am so sorry for taking up space with this useless thread. I completely forgot you can just play animations willy nilly through code and they don't need to have transitions.