Search Unity

Specific animations not working from instantiated prefabs

Discussion in 'Animation' started by Vraelis, Feb 6, 2015.

  1. Vraelis

    Vraelis

    Joined:
    Sep 9, 2014
    Posts:
    1
    Greetings unity devs o/
    So I'll go straight to the point.
    I've been experiencing this problem for a couple days and I'm still stuck at this problem.
    So the situation is:
    I'm currently developing an endless running multiplayer game for my final task/thesis
    in my game there are 2 modes : single player and multiplayer
    To differentiate the singleplayer and multiplayer I create different scenes for them
    so let's name it singleplayer scene and multiplayer scene

    On single player scene I have a character (prefab name is running_0,I will provide you some screenshots)
    for this prefab's detail you can see it in ss below

    On multiplayer scene I have 2 character prefabs (for multiplayer I use photon unity networking assets) so I instantiate them with PhotonNetwork.Instantiate
    I name my first character as Nero and second character as Roen
    technically they are all same character except Roen is blue while Nero is red
    Screenshot (158).png Here is the condition

    running_0 prefab's animator is the same with Nero's animator I copied them, but I use different scripts for Nero and Roen

    Shortly,

    -running_0 has its own scripts , Nero and Roen too (but the script code are exactly the same,only modify a bit for multiplayer mode,I will show you the code if maybe needed)

    - running_0 and Nero has the same animator

    -Roen has different animator


    In this multiplayer or single player game, the character can attack and parry

    when attack, I have a prefab for spawning the "swordwave" and "parry effect" which is a child from the parent gameobject(so it always follows the character and spawn at the right place)

    So the question is :

    1. spawning swordwave and parry effect is working perfect in single player scene but not in multiplayer scene (although the hierarchy of parent and child of the player prefab is exactly same), the wave just keep spawning at the beginning of stage

    2. running_0,nero,roen animator has same structure and animation,in single player running,jumping,attacking,parrying, works perfectly fine. But in multiplayer mode, the only animation that works perfectly is running and jumping (when attack,it spawn the wave but with the bug as mentioned above,and parry too) and all of the animations mentioned above are in the same animator


    I wonder if I should create nero's own animator ?

    but if it is because the animator, why roen has the same bug as nero's?
     

    Attached Files:

  2. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    I don't know what is wrong, but here is a trick to help you find out. Select the character or character's rig in Unity while the game is running, and then open your Animator Controller, and see if you can see the animations playing. If the animations are playing, you should see a line at the bottom of the animation node that moves from 1 side to the other. If the animations are playing in the Animator Controller, but not on your character, the first thing I would do is double check the rigs of the characters, and the animations.