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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Animation clip skipping keyframes at FPS drop?

Discussion in 'Animation' started by Ccrawler, Oct 27, 2018.

  1. Ccrawler

    Ccrawler

    Joined:
    Feb 8, 2017
    Posts:
    9
    I have a simple setup in my animation clip for a sword attack:



    Just a basic sprite animation and two gameobjects that are disabled/enabled via keyframes.

    One of the GameObjects is a "damage" object (collider) I use as a slash for attacks, so it turns on on a certain part of the attack and then turns off on another. Simple enough.

    But I noticed with horror that when the editor started to skip frames due a lot of stress (I'm using playmaker and it seems to lag when debugging on runtime), sometimes the keyframes that turned on the damage object were skipped, so some attacks didn't do damage at all.

    Haven't tested this on a build at low FPS, but is this behaviour expected? Or is it only something that happens on the editor preview?

    As a side note, the Animation Events fired consistently; only the keyframes were skipped sometimes, but as you can imagine that would break the game if the fps drops (sometimes the attacks won't have effect).

    Thanks in advance for your help!
     
  2. Ccrawler

    Ccrawler

    Joined:
    Feb 8, 2017
    Posts:
    9
    Nobody? Is it a bad practice to change properties that will affect gameplay in animations? Are they frame dependant?

    Animation events seem to fire reliably, should I move to that approach exclusively?