User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Collission between two copies of an active only when both are on the same layer

  1. #1
    Clicker Fusion 2.5
    troshinsky's Avatar
    Join Date
    Jun 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Collission between two copies of an active only when both are on the same layer

    Hi!

    Iīm working on a pinball game using the physics objects and itīs going great so far but I run into this problem I canīt figure out:

    I am using 4 layers for ramps and such and when there are several balls on the playfield I want them to collide with each other only if they are on the same layer. When I check for a collission between two copies of the ball active, how can I check that they are both on the same layer?

    I was trying:

    If collission between "ball" and "ball"
    Layer of "ball" = Layer of "ball" > Stop "ball"


    But of course it does not work. It stops both balls even if they are in different layers.
    Any ideas?

    Thank you very much!

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module

    Join Date
    Dec 2013
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Collisions only work if the objects are on the same layer. It does not work accross multiple layers. So a ball from layer 1 cannot collide with another one on layer 2.

  3. #3
    Clicker Fusion 2.5
    troshinsky's Avatar
    Join Date
    Jun 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes they do, when they are physics objects.

    See attached:
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    990
    Mentioned
    50 Post(s)
    Tagged
    0 Thread(s)
    The physics engine doesn't respect layers, I don't know if the issue has been reported to the bugbox though. Your method with the additional layer condition probably leads to an issue with object selection. Have your tried a for each loop where the layer of each ball is the entering condition? So you would have four loops for your four layers and only the balls in each specific layer are checked.

    edit: my solution is not working, the physics engine does not execute the stopping action when the collision detection is done within a for each loop. Other actions are regulary executed...

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    Lacey, WA
    Posts
    756
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just an idea, have you tried using multiple Physics Engine objects on each respective layer, and switching the Engine ID of your objects to whatever layer they are on? Haven't tried this, not sure if it will work or not...

    Edit: I guess there's no way to change an object's Engine ID on the fly? You might be able to do this with multiple Movements, one for each Engine ID, and switch the object's Movement to match A) which layer it's on and/or B) which Physics Engine it should be responding to.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS 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)
    Sparckman's Avatar
    Join Date
    Feb 2011
    Location
    Planet of the Kangaroos
    Posts
    1,396
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    Clicker Fusion 2.5
    troshinsky's Avatar
    Join Date
    Jun 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bipolar_Games View Post
    You might be able to do this with multiple Movements, one for each Engine ID, and switch the object's Movement to match A) which layer it's on and/or B) which Physics Engine it should be responding to.
    After a quick test this seems to work, but itīs problematic as it would mean I have to reassign every object that balls collide with on each layer to a new engine. The problem with this is that most objects are attached to a "surface" on the first layer, so you can move the whole playfield with everything attached to it. This works very well and itīs actually really important for the game. Having things collide across layers is pretty useful for me, just not for the balls. I would prefer to simply compare the layer value of two colliding objects, which is very easy to do for two different objects, I just donīt know how to do it for two copies of a single one.

  8. #8
    Clicker Fusion 2.5
    troshinsky's Avatar
    Join Date
    Jun 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sparckman View Post
    Yes I am using IDs for every ball but that still doesnīt give me a clue of how to compare that both balls are on the same layer during a collission.

  9. #9
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleUniversal Windows Platform 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)

    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,421
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I was having the same problem with 1 of my games.
    I had to put them all on the same layer in order to make it work.

  10. #10
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    It would be great in general to be able to have an option on objects if they should detect collision on all layers or only on its current layer.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How to make multiple copies of an active move toward the same point?
    By LemonyLime in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 11th January 2012, 12:28 AM
  2. Active picture object - slowdown on layer 2
    By willy in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 27th August 2011, 07:21 PM
  3. Active Object not Following Frame (layer)
    By Giovanni_Cardona in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 15th December 2010, 11:47 AM
  4. Active Picture bug (move to layer)
    By Nifflas in forum File Archive
    Replies: 1
    Last Post: 11th March 2008, 06:37 PM
  5. Active Picture bug - cannot recieve Layer
    By MelliGeorgiou in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th October 2006, 12:32 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
  •