Another collision issue with multiple instances

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Some of the main issues I always seem to run into with Fusion, is having multiple instances of an object.

    Basically I'm trying to make an object stop when it hits the ground, or a platform. I could use "is overlapping a backdrop", but then I'll have the issue of the object not stopping, until it's actually overlapping, which means it'll sometimes appear "in the ground". To get around this, I decided to create an event that detects when the object is a pixel or 2 above the platform/ground, then stop. It works great, but only on the latest instance of the platform. It either completely ignores all other instances that are below it, or it'll stop at a weird place, nowhere near them.

    Here's a screenshot of my event that works perfectly on the last instance placed in the frame. If anyone could give me any suggestion about why this might happen, or how to fix it, I'd very much appreciate any advice. Also I tried using "For Each Loop" and it didn't help. Thanks!

    Please login to see this attachment.

  • The main problem is that you are using the built-in movements. They don't guarantee a collision check for every pixel moved, so your objects are not detecting the overlap at the right time every time an overlap occurs. You should look at DavidN's fastloop tutorial to see how to approach moving objects in fastloops.

    But based on your code, you could just add an "Is overlapping (object name)" as a condition to your event line. Then add an additional action that repositions your character sprite to the proper Y position above the platform. The only downside here is if you happen to overlap multiple copies of the platform at the same time, MMF will only detect the last platform object created. So you would want to use a ForEach loop to figure out which platform you are touching.

    Please login to see this link.

  • Seems like a task for the always-foreach pair XD

    You should probably "foreach" your platforms,
    and possibly your colliding objects if more than one...

    also, there's some solution to this:

    Quote

    I could use "is overlapping a backdrop", but then I'll have the issue of the object not stopping, until it's actually overlapping

    a "pushout" loop would work fine,
    like:

    object overlapping platform
    >>> start loop "pushout"

    on loop "pushout"
    >>> set object position to Y-1

    on loop "pushout"
    +object overlapping platform
    >>> start loop "pushout"

    a selection of my Fusion examples can be found Please login to see this link.

  • I got what you mean,
    but this would result in the object being pushed out "visibly" one pixel per frame
    (if overlapping more than one pixel)

    while I meant "restarting" the loop, on loop XD,
    while object still overlaps, and making it move just one pixel at time
    would (*should*) result in the object stopping exactly above the platform without any visible displacement
    because all would happen in the same frame

    like this:
    Please login to see this attachment.

    a selection of my Fusion examples can be found Please login to see this link.

    Edited once, last by schrodinger: added example (October 28, 2015 at 5:27 PM).

  • oh sorry, I didn't specify, all loops were performed 1 times X)

    just a matter of habit,
    that would give the same result I guess :D

    a selection of my Fusion examples can be found Please login to see this link.

  • This works PERFECTLY. I can't believe I was so close to figuring it out, yet so far. I actually first tried it with a fastloop, but the part I missed out was the second "On loop "pushout" + overlapping platform".

    Anyway it's working now so that's all that matters. Thanks very much for the help!

    Edited once, last by Enchantainment: Typo! (October 29, 2015 at 10:55 AM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!