Difficulty setting animation frame. Yay math!

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Howdy, and thanks in advance for any assistance!
    Beating my head against a wall today trying to figure out how to express the logic behind my main actives. I am trying to use a little math and 2 global variables to determine the frame number.

    Global Value A = 10
    Global Value B = 100

    A behavior inside the active:
    Always -> Force Animation Frame ((Global Value A / Global Value B)*21)
    Expected behavior: A number between 0 and 21 based on the percentage generated by dividing the two values being used as the animation frame, the corresponding frame displaying on the screen 'always'.
    Actual behavior: Frame stuck at 0.

    Other methods attempted:
    Build a list of behaviors inside the active conditioned like this : compare two values ((Global Value A / Global Value B) * 21 <1 ---> Force Animation to frame 0, compare two values ((Global Value A / Global Value B) * 21 >= 1 ---> Force Animation to frame 1 etc..
    rounding the product of the calculation in case decimals are being interpreted round((Global Value A / Global Value B)*21)
    I deleted the active and built it again in case there was a hidden behavior lurking somewhere.

    Ideas? Thanks again!

  • (Global Value A / Global Value B)*21) with Global Value A = 10 and Global Value B = 100
    results in
    (10/100)*21 = 0.1*21 = 2.1

    Edit:: Since you use 10 in stead of 10.0 it will not result in 0.1 but in 0

    Maybe best to use the Random expression

    Please login to see this link.

  • Quote

    (Global Value A / Global Value B)*21) with Global Value A = 10 and Global Value B = 100
    results in
    (10/100)*21 = 0.1*21 = 2.1

    Edit:: Since you use 10 in stead of 10.0 it will not result in 0.1 but in 0

    Maybe best to use the Random expression

    Oh how wonderful! So my problem is that I am excluding decimals by not initiating the variable with them, where just before I multiply by 21 anything low is resulting in 0. I cant use random because the two values are contextual. A is a bottles current volume, and B is the same bottles maximum value, there are 21 frames, so basically I am trying to select a frame based on what percentage filled the bottle is. Ill try adding .0 to A and B and see if that helps, Ill check back in a few minutes!

  • And bam, just like that! The solution: Since you use 10 in stead of 10.0 it will not result in 0.1 but in 0
    I added decimals to the variable assigning events and voila everything works as intended now. Mickarrow, im a bang up 3d animator, if u need something, hit me up! Thanks for the help.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!