Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question PNG Sequence And Bone Transform Out Of Sync

Discussion in 'Animation' started by DotArt, Apr 22, 2023.

  1. DotArt

    DotArt

    Joined:
    Jun 12, 2021
    Posts:
    82
    Hey, so i have two animation that i'm trying to sync up, one is a PNG sequence at 24fps with a new png every frame. The other is a bone transform with a keyframe on frame 0,5,10,(14) to make a loop.

    The animation does loop sync perfectly the problem is when i pause and go through it frame by frame the bone animation looks like its updating twice for every time the sprite changes, so it is updating at more like 48 frames a second even though it is set to 24 and the sample rate is set to 24, is there something i can do to fix this
     
  2. ElXill

    ElXill

    Joined:
    Jun 2, 2017
    Posts:
    43
    I think fps of your animation doesn't matter, Unity samples animation curves according to it's own frame rate. So if your ingame fps is 60 and animation fps is 24, still animation curve values are sampled according to 60 fps, so it will take 3 more samples between each frame.
    You can use constant curve in animation instead of other curves in your animation program or edit them in Unity to keep your animation sample same until animation's fps goes to the next frame. This may result in somewhat choppy animation but since you are using sprites I'm guessing this is what you want.
    You can see in the picture below green lines are animation frame rate changes but unity may sample the animation curve from inbetween values such as red line.
    AnimationCurves.jpg
     
  3. ElXill

    ElXill

    Joined:
    Jun 2, 2017
    Posts:
    43
    Also unchecking Resample Curves box may help too. ResampleCurves.jpg