Forum rules - please read before posting.

Animation plays faster on different machines

I seem to be asking a lot of questions but I guess it's the best way to learn. As an added note I have looked online and through this forum and no real solution, this post comes after some research.

so I am making my game in unity and exported a build to test on a different machine today. I discovered that my walk cycle is A LOT faster on another machine.  After doing some research I basically learnt thatI need to make my frame rate independent using delta.time. My question is, where should I add the script to do this? I don't want to code it in to the wrong location. Is there another way to do this, is there something I am missing out on?

Comments

  • Generally animation should be handled by Unity's own animation systems, unless you're using some kind of custom engine.  What animation engine are you using?
  • Hi Chris, no fancy engines sprites unity is being used. Strangely when I test at home and export a build of my game it runs fine, but then I run it on my laptop and the animations a fair bit quicker...
  • Again thank you for your help, you are so on the ball!
  • Any assistance on this? I have tested on 4 different machines and I am not using an external animation tool but my animations play differently
  • I believe you, but nowhere in AC's code does it actually set the framerate of your sprite animations.  The animations are played using the regular Mecanim animation system, which means the playback speed is controlled entirely through Unity.

    The one thing I can think of is that if you have one machine that is particularly slow, it may not like the try/catch statements in AnimEngine_SpritesUnity.cs.  Open up that file, and find the function named PlayStandardAnim (around line 599).  This is the function through which all idle/walk/talk sprite animations are played.

    Try commenting out the try/catch statements so that lines 608 onwards read:

    if (character.crossfadeAnims)
    {
        character.GetAnimator ().CrossFade (clip, character.animCrossfadeSpeed, 0);
    }
    else
    {
        character.GetAnimator ().Play (clip, 0);
    }

  • edited September 2015
    Thanks so much Chris, will try it out. I think I will have to have you in my credits for my game one day and when it releases fly to you and have a few beers to say thanks for the help :P

    I was also playing around and it seems to be when I disable "only move when sprite changes" it seems to keep the animation in check.
  • Mine's a Guiness!

    That checkbox might be a clue.  Are you certain that the problem is that the animation is playing faster, or could it be that the character's movement across the screen is faster?
  • AH! you just made me think, ok so the animation plays the same speed but he moves faster across the screen. 

    Guiness it is :)
  • edited September 2015
    I would rather have "only move when sprite changes" checked as the movement feels more rigid and less floaty 
  • Sure - if it's an option, it has to work.  Could be quite difficult, but at least now I'm closer to understanding the problem.
  • Awesome, well this may help more people in the future so we doing good right? :P

    Are you a gamer Chris? I work in the gaming industry so I might have a way to reward you for your help as the beer might have to be put on hold lol
  • I'm all ears!

    Turns out the problem is also reproducable if you use the "Engine: Change timescale" Action to slow down time manually.  Should be fixed in v1.48, which'll be out soon.
  • HAHA what is your main platform to game on (console or PC?)
    As for solution will keep developing the game and should be fixed in the new release :)
  • PS4 - I moved to the couch for gaming years ago since PCs needed to be upgraded every year to keep on playing.

    v1.48 is out - grab it while it's hot!
  • edited September 2015
    Good man, will fetch it this eve.
    Do you play Destiny? and if so do you have the Taken King? I just upgraded my rig as I am SUPER keen on oculus! 
  • No - I may be a console boy, but I still think the PC is the only way to play FPS games.  Serious Sam FTW.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.