User Tag List

Results 1 to 8 of 8

Thread: Collision between 2 instances of same object

  1. #1
    Clicker 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)
    Unknowner's Avatar
    Join Date
    Oct 2011
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Collision between 2 instances of same object

    Hello I have a 20 instances of same object with Bouncing ball movement (non-physical movement) following the player, i want they dont overlap between them, i want when they collision a bounce, I used fastloops but still not working, how I do this?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS 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)

    Join Date
    Oct 2007
    Location
    UK
    Posts
    306
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Hi, there's probably a few ways, but when I was making a game based on Gauntlet, the best method I found to prevent instances overlapping each other was to make 4 detectors(invisible walls) around each instance. I'd then check for overlaps with a detector on the east of an instance, and a detector on the west(and north and south). So if east overlaps west, do something - and same for north & south. I'd also use fast loops and spread IDs on the detectors so they'd match the instances. Only downfall to this method is the use of lots of detectors and a few fast loops; so it can be a resource hog.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Apparently, you don't need to suffer that much with on-collision events:

    collision_instance.mfa

    what issues are you experiencing?

    But I remember having same issues as Caesar says with overlapping
    and using detectors to solve as well
    (although you'll probably need just one-per-object in this scenario)

  4. #4
    Clicker 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)
    Unknowner's Avatar
    Join Date
    Oct 2011
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Caesar View Post
    Hi, there's probably a few ways, but when I was making a game based on Gauntlet, the best method I found to prevent instances overlapping each other was to make 4 detectors(invisible walls) around each instance. I'd then check for overlaps with a detector on the east of an instance, and a detector on the west(and north and south). So if east overlaps west, do something - and same for north & south. I'd also use fast loops and spread IDs on the detectors so they'd match the instances. Only downfall to this method is the use of lots of detectors and a few fast loops; so it can be a resource hog.
    That's a great idea but the problem it's what u say, it will use to much memory if i have a lot of instances

  5. #5
    Clicker 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)
    Unknowner's Avatar
    Join Date
    Oct 2011
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by schrodinger View Post
    Apparently, you don't need to suffer that much with on-collision events:

    collision_instance.mfa

    what issues are you experiencing?

    But I remember having same issues as Caesar says with overlapping
    and using detectors to solve as well
    (although you'll probably need just one-per-object in this scenario)
    That exemple works fine, but if u try to put a object, and a Always look in direction of that object (moved by player) they start overlaping

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    mmm, I fear what you ask for can hardly work fine

    you want 20 objects to follow another single object,
    and bounce one from the other
    but bouncing means that they should stop--> aim towards a different direction --> restart
    and so they can't "always" move in direction of player, at least while bouncing

    if you force them to always look at player, they can't freely bounce

    you can have them pushing out each other with some looping but I fear this could end up being a mess

    maybe "disabling" look-at-player code for a small moment after bouncing, and reactivating shortly afterwards..?

    EDIT
    example:
    collision_instance_bounce.mfa

  7. #7
    Clicker 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)
    Unknowner's Avatar
    Join Date
    Oct 2011
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice one that works, also sparksman did a video answering me about the same :P, here is the link https://www.youtube.com/watch?v=rqC2d_W_dHA

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    oh, I see... we've come to a very similar solution

    if you want some less jitteryness the only way would probably be detectors & loops as Caesar said

    OR
    since this project seems particularly suitable for this
    IF
    windows or IOS only
    you can try Anders Riggelsen's Flocking extension

    see above example with flocking:
    avoid_collision_flocking.mfa

Similar Threads

  1. Another collision issue with multiple instances
    By Enchantainment in forum Fusion 2.5
    Replies: 8
    Last Post: 29th October 2015, 11:54 AM
  2. Collision between two instances of a same object
    By DavidT in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 16th July 2014, 01:58 AM
  3. Collision between different instances of the same object
    By DavidT in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 14th May 2014, 03:20 AM
  4. Having problems with collision detection of same object instances.
    By DPowell in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 14th November 2013, 05:00 AM
  5. Coding Collision detection for Multiple Instances with fastloops
    By alxmrg in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 12th February 2012, 10:33 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
  •