Collider for Multiple Instances of an Enemy

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.
  • I am trying to create a collider that maps to an enemy's X position.

    I have tried placing the collider over each instance of the enemy in the frame editor, and using "collider is overlapping enemy - set X position of collider to enemy". This works up until two enemies overlap, then one "Steals" the other's collider. I have tried everything imaginable to scope the objects so that the colliders are unique to each enemy, but nothing is working. I tried matching their instance values, using fixed values, but the best I'm able to get is one collider follows the enemy while the rest don't move.

  • I often have trouble picking the right objects myself. Sometimes it doesn't work at all, sometimes unreliable. I have some code here that has worked reliably so far. Player can be your enemy and the hat is the hitbox.

    creating loop
    Please login to see this attachment.

    pick objects with same instance value
    Please login to see this attachment.

    Compare instances is a good method and in my case I added a loop for each Player. Loops can fix things which work mostly but not always (when two events happen at once maybe??)

    My code is just for picking, the overlapping can make things more complicated. I documented some strange overlap behaviour in this thread:
    Please login to see this link.

    If it doesn't work, try to separate the code like.... Set variable A to 1 when things overlap and 0 if not. In another line ask for instances and objects with variable A at 1. I'm just guessing, it's hard without seeing your code.

  • Please login to see this attachment.

    This is the code. I feel like this worked for me in the past. All the objects are created at the right positions, and I checked in the debugger and all the valuse for each object line up properly. None of the objects move at all, though. What is going wrong?

  • Please login to see this attachment.

    This is the code. I feel like this worked for me in the past. All the objects are created at the right positions, and I checked in the debugger and all the valuse for each object line up properly. None of the objects move at all, though. What is going wrong?

    I was going to type out how I do it.
    However, I just made an .mfa for you.
    The Example I made, allows you to create as many enemies as you wish or destroy as many as you wish.
    All of them have their own Collision Boxes.
    LINK: Please login to see this link.

    Edited 2 times, last by VBEinc (February 4, 2023 at 12:18 AM).

Participate now!

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