Search Unity

Time sensitive animations

Discussion in 'Scripting' started by Borderline Chaos, Sep 1, 2015.

  1. Borderline Chaos

    Borderline Chaos

    Joined:
    Aug 7, 2012
    Posts:
    47
    I'm going to be using scripting to move players around in my game and control their animations. The game is turn based but with a timer. The player enters in a couple commands, a lot of calculations are made and the results are used to build a Combat Sequence.

    The sequence plays out over four seconds and consists of four "turns" before the sequence repeats. At exactly 1.0 seconds into the sequence I want the next turn to start. This holds for the next two turns. While this should be easy to accomplish, I'm worried about the feasibility of the next part.

    To construct the Combat Sequence I have created an array of objects. One member of the object is a list of animations to be executed at specific moments during the turn. At second .08 of the round I want the first animation in the list to be executed, at second .16, the next animation, at second .25 another, etc until the list is complete.

    The animations are essentially different poses for the player that are specific to the results of the calculations.

    Question 1- Will doing this sort of thing cause Unity to explode?

    Question 2- Is using a timer on a FixedUpdate the best way to get consistent values for a variable that holds my Time.delataTime so that I can create conditionals for my Animation Controller?