Search Unity

Resolved Starting two animations of different objects at the same time.

Discussion in 'Animation' started by Ahmed00702, May 19, 2023.

  1. Ahmed00702

    Ahmed00702

    Joined:
    Mar 17, 2023
    Posts:
    2
    Hello, I have two GameObjects (one parent and it's child) that are supposed to play an animation each at the same time. I am using two triggers (one for each object) to start both animations that is called by a script. Both animations are run at the same sample rate, have the same amount of frames and are at the same speed. When the script calls the trigger, it calls both triggers at the same exact time. However, for some reason, one animation (the parent object's) seems to be a little bit later (about 2 frames) than the other. I checked the transitions and there is no exit time applied at all and Transition Duration is set to 0. Any idea why this could be?

    I am trying to get the animations to have perfect timings.
    Thank you
     
  2. Ahmed00702

    Ahmed00702

    Joined:
    Mar 17, 2023
    Posts:
    2
    It seems that this was caused by the lines that activated the triggers. Those lines were included in the OnTriggerEnter method which caused some kind of latency of some kind. As soon as the triggers were called outside this method, both animations played at the same time. This thread can be closed.