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.

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