User Tag List

Results 1 to 6 of 6

Thread: Adjusting object's angle and position based on another object's angle and posistion?

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Jun 2016
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Adjusting object's angle and position based on another object's angle and posistion?

    So I've attached an animated GIF to try and explain this better.

    Basically I would like to be able to attach a smaller object to a larger object, and have the smaller object's angle and position change correctly as the bigger object's angle is changed.
    Imagine the bigger object is a room and the smaller object is a chair in that room. When rotating the room, the chair would change position and angle to stay in the correct spot within that room.
    If my explanation is poorly worded, just look at the GIF and it should make sense. Anyone got any ideas on how I can pull it off? Thanks!
    Images attachées Images attachées

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    893
    Mentioned
    13 Post(s)
    Tagged
    1 Thread(s)
    You can use an Action Spot in the corner of the big object as an anchor and then just set the angle and position(based on Action Spot) of your smaller object to match the bigger one.

    edit: There is no real point in dividing it into 2 events like I did in my example. For some reason I just wanted to separate the parts where I just rotate the big one from the part where I move and rotate the smaller one.
    Attached files Attached files

  3. #3
    Clicker

    Fusion 2.5Android Export Module

    Join Date
    Jan 2007
    Posts
    257
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Here is a way to do it with multiple objects and trig.

    The issue is that this can only be applied to a certain extent. Handling object movements while they're attached becomes a whole different ball game that I wouldn't be comfortable throwing together myself. This example can scale to an infinite number of objects, though.

    Arrow keys rotate, clicking creates a new object
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    650
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    This is a very good approach.

    There is a small thing that should be added in line 7 though:
    X( "Base Object" ) + Cos(Angle From( "Sticky" )) * Dist( "Sticky" ) + 0.5
    Y( "Base Object" ) - Sin(Angle From( "Sticky" )) * Dist( "Sticky" ) + 0.5

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    637
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Great example, Gamester.

    Some advice too: you should set X and Y of player to Round(xpos) and Round(ypos) to avoid floating point precision errors in Fusion. This is a problem that annoyed me for the longest time until a Clickteam member helped me out. When trying to make a smooth camera, I noticed one side would be offset by a pixel or two when easing. Setting position to Round(pos) instead of just pos kept it smooth but eliminated that problem.

    This is probably what @Wodjanoi 's tweak fixes.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    650
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Yes, both methods are possible in this case to prevent the floating point issue.

    I learned about this at a relatively late stage too - I assume it was the same helpful person who informed me and solved a wobbly camera problem in one of my projects.

Similar Threads

  1. moving based on angle (MFA attached)
    By cfullerNY in forum Fusion 2.5
    Replies: 3
    Last Post: 18th November 2014, 03:22 PM
  2. Replies: 4
    Last Post: 8th June 2012, 12:50 AM
  3. Fast loop for adjusting the angle of a line
    By ac3raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 10th May 2011, 03:45 AM
  4. position object and angle from another object?
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th July 2010, 12:43 PM
  5. Saving Frame Position does not save the angle
    By dustingunn in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 2nd August 2007, 08:46 AM

Posting Permissions

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