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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Can I get the number of frames in a animation clip from a script?

Discussion in 'Animation' started by Deleted User, Apr 14, 2022.

  1. Deleted User

    Deleted User

    Guest

    How can I get the total number of frames in a animation clip from a script?
     
  2. Deleted User

    Deleted User

    Guest

    I found AnimationClip's length parameter, but it's in seconds.
    I also found the framerate parameter.
    I think the length of the clip in frames can be determined with this,
    but I can't figure it out.
     
  3. Deleted User

    Deleted User

    Guest

    I think I'm supposed to multiply the two if I want the length in frames. I'm just gonna do that, hope it's right, and move on I guess. :(

    Edit: Unsurprisingly, it didn't work.
     
    Last edited by a moderator: Apr 15, 2022