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 Animations Only Play After I Select a GameObject

Discussion in 'Animation' started by QuickiSticki, Jan 30, 2022.

  1. QuickiSticki

    QuickiSticki

    Joined:
    Nov 18, 2020
    Posts:
    26
    Hey everyone!

    I am working on animating a bow in my game. Locally, everything is working great, and has been for a long time. However, I am now getting the animations set up over a network (using Mirror). I have run into an issue that I have not seen with any other animators over my network. The problem is this; When I first start the game and equip a bow, no animations are shown across the network for the bow. However, once I select any GameObject in the hierarchy, the bow animations start showing correctly over the network, and remain working until I close the match or drop the bow, pick it up, and re-equip it.

    If anyone has any ideas, please let me know! Otherwise, I will keep problem solving it on my end.

    Thanks!
     
  2. QuickiSticki

    QuickiSticki

    Joined:
    Nov 18, 2020
    Posts:
    26
    I figured it out myself. I had a script on the bow that controls the animations for it. This script only "works" for the local player, but was not disabled on non-local player characters. Something from this script was interfering with the animations. When I was selecting a gameobject in the scene, my script was getting turned off, like it was supposed to be, and then the animations worked. All I did to fix it was to add a bit of code to turn the script off during its Start() if it was not the local player.