User Tag List

Results 1 to 6 of 6

Thread: Objects can't collide or overlap if they are on different layers?

  1. #1
    Clicker Fusion 2.5SWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SuperDisk's Avatar
    Join Date
    Jul 2012
    Location
    USA #1
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Objects can't collide or overlap if they are on different layers?

    I've got a HUD element that is on layer 2. I want to see if the player (on layer 1) is underneath it so it will turn transparent.

    If the player is overlapping the HUD element, then turn it transparent, if not, turn it opaque... This works fine and dandy if they're all on layer 1. However, the HUD is on layer 2, and so it doesn't register as a collision or an overlap..

    Is this a bug or some sort of annoying feature? How do I work around this?

    Thanks.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Collisions and overlaps only works if the objects are on the same layer.

    You can place an additionall object always at the player position on layer 2 to work around it, or code if player > y hud etc...

  3. #3
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    This is not a bug. Have an invisible active, the same size as the hud, on the same layer as the player and have it follow the frame as the hud. Have that register as a collision or an overlap.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  4. #4
    Clicker Fusion 2.5SWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SuperDisk's Avatar
    Join Date
    Jul 2012
    Location
    USA #1
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ended up doing a similar method to Nivram. I had an invisible active player on Layer 2 that did collisions and stuff, but this is quite an unfun feature.

    Layers are so great, why do they have to have this..

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SOLUTION A
    3 Events:

    The graphical screen will only update once all Events have been checked, so it does not matter what you do ( in this case change Layer of the HudElement ) as long as you undo it before the Event Editor finished reading its last Event
    Example:

    Say you have a Dog in your empty ( blank white ) Frame.

    + Allways
    -> Create House at x,x

    + Allways
    -> Create Sun at x,x

    + Allways
    -> Create Moon at x,x

    + Allways
    -> Destroy House
    -> Destroy Sun
    -> Destroy Moon

    If you run the Application, all you will ever see is a Dog against the white blank Frame, because you both create and destroy the other Objects before the graphical screen updates.

    + Allways
    -> HudElement move to Layer P ( same Layer as Player )
    -> HudElement change effect to Opaque

    + If HudElement is overlapping Player
    -> HudElement change effect to Semi-Transparent

    + Allways
    -> HudElement move to Layer H ( moves it back to the Hud Layer )

    ...
    SOLUTION B
    2 Events:

    Im assuming your HudElement resides at a fixed positioned in the Window ( which HudElements usually do ).
    In that case you allways know where the HudElement is located relative to the Window, so all you realy need to do is compair the Players position to check if hes located in the HudElement Area ( eliminating the need for an Overlap check ).

    + Allways
    -> HudElement change effect to Opaque
    ( this Event can be made more efficient, but ill keep it simple for simplicitys sake )

    + Player X position >= Xcoordinate1 ( left edge of HudElement area )
    + Player X position <= Xcoordinate2 ( right edge of HudElement area )
    + Player Y position >= Ycoordinate1 ( top edge of HudElement area )
    + Player Y position <= Ycoordinate2 ( bottom edge of HudElement area )
    -> HudElement change effect to Semi-Transparent

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by salamanderpants View Post
    There should be a simple option within each object's properties to change which layer(s) it interacts with. Perhaps this could be included in MMF3?
    Collision Mask controll would be nice yes.

Similar Threads

  1. How to get the coordinates of the two objects collide
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 12th February 2012, 09:25 PM
  2. How do I collide on different layers?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th September 2011, 09:37 PM
  3. What is a better way of making objects collide?
    By Krim in forum File Archive
    Replies: 4
    Last Post: 25th January 2007, 11:28 PM
  4. How put objects into groups and let them collide?
    By The Thinker in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd November 2006, 11:14 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
  •