User Tag List

Results 1 to 6 of 6

Thread: Difficulty setting animation frame. Yay math!

  1. #1
    No Products Registered

    Join Date
    Dec 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Difficulty setting animation frame. Yay math!

    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!

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jul 2010
    Location
    Belgium
    Posts
    244
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    (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

  3. #3
    No Products Registered

    Join Date
    Dec 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    (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!

  4. #4
    No Products Registered

    Join Date
    Dec 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Feb 2014
    Posts
    953
    Mentioned
    16 Post(s)
    Tagged
    1 Thread(s)
    lol. that has to be the best thank you i've ever seen

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jul 2010
    Location
    Belgium
    Posts
    244
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    No problem, glad I could help.

Similar Threads

  1. Force Animation Frame or Change Animation Sequence?
    By darkmanx_429 in forum Fusion 2.5
    Replies: 4
    Last Post: 2nd April 2014, 01:24 AM
  2. Difficulty in setting up Conveyor Belts
    By fawfulfan in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th July 2011, 10:23 PM
  3. easy math to convert mouse position to frame?
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 17th February 2010, 05:12 AM
  4. Setting Animation via String
    By astrospoon in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th August 2008, 10:15 PM
  5. [Question about speed] Animation or Math?
    By Durnus in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 28th January 2007, 03:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •