User Tag List

Results 1 to 4 of 4

Thread: Problem with scaling objects.

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Gradius's Avatar
    Join Date
    Jul 2015
    Posts
    117
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Problem with scaling objects.

    Hi everyone, if I set Xscale of object A to 2.1 and then make a condition that "if Xscale of object A = 2.1 then destroy object A, this doesn't seem to work, but I have no idea why, can anyone explain what I'm doing wrong here?

  2. #2
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    166
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Gradius View Post
    Hi everyone, if I set Xscale of object A to 2.1 and then make a condition that "if Xscale of object A = 2.1 then destroy object A, this doesn't seem to work, but I have no idea why, can anyone explain what I'm doing wrong here?
    If you use something like this instead it seems to work;
    scaler.png



    I think this might be something to do with how XScale stores its value, maybe some kind of floating point precision error (i.e. it's not *exactly* 2.1, it might be something like 2.100000001). The problem doesn't happen if you're using whole/integer values.

    Weirdly, the same problem happens if you set the object's Alterable Value A to the XScale of the object and check for that instead. This example won't destroy the object
    scaler2.png



    The best way I can think of handling something like this though is setting one of the object's values to the scale you want to use, and setting the scale from that Alterable Value. That way you can compare the alterable value itself. This also has the added benefit of working across multiple objects (if you have them) rather than all objects that the 'compare two general values' would scope to.
    scaler3.png

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,420
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    You could also round the Xscale value to get rid of the floating point precision error like this: Rounding XScale.mfa

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Gradius's Avatar
    Join Date
    Jul 2015
    Posts
    117
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies guys! I think I'll just use alterable values to set scale, as this seems to work as expected, cheers!

Similar Threads

  1. Inconsistent Behavior when scaling objects
    By killer1one in forum Android Export Module 2.5
    Replies: 2
    Last Post: 30th September 2014, 03:38 PM
  2. Scaling objects properly?
    By dnlhern in forum Fusion 2.5
    Replies: 3
    Last Post: 15th June 2014, 08:18 PM
  3. Scaling Objects with Alpha Chanells?
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd August 2012, 11:06 PM
  4. Scaling objects smoothly
    By Mantoid in forum Hardware Accelerated Runtime
    Replies: 3
    Last Post: 30th October 2008, 11:20 PM
  5. Smooth Scaling of Active Objects?
    By Renatos in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 13th March 2008, 05:48 PM

Posting Permissions

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