Is it possible to distinct between instances of the same type in events and actions?

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.
  • You see, there is a quarantine because of COVID-19 so I have not much to do, so it got me thinking: is the following simple case even possible? No helper objects etc., just plain events:

    Let's say that if two instances of object A collide, you want to destroy only the one which has lower ALT VAL A than the other one, for example. There might be many instances, so it not a 1:1 problem.

    We would need to scope both objects for checking of their values, and then scope only to the one whose is lower. I could think of complex, probably overengineered solutions using loops, fixed values and lists, but maybe there is an easier way?

    Edited once, last by Blizna (April 1, 2020 at 2:50 PM).

  • This has always been one of Fusion's weaker points. There is no extremely easy solutions for it, but as you say, you can run loops and keep track of fixed id's and values that way. The best way is probably to run a ForEach loop on overlapping objects. Fusion will then only scope through the objects that are overlapping, making your work a bit easier.

  • And when you need to do actions on both objects, it seems almost impossible. By that I mean a case like this:

    -When A overlaps another A, move A with the lower value X above the other A.

    Trying to solve it, just for fun, but even with ForEach seems difficult, particularly because if there are many instances, the order matters.

  • Thanks Manuel. Frankly I am unsure how to make the scenario I described to work: let's make it simple: when two instances overlap, let's always move the one with higher Y position above the other one. (I mean Layer object action, Move object A above object B - I chose this action because it requires two instances).

  • Ordering instances of the same object above/below on a single layer is something i tried also in the past long time with no success, i spend now also two hours tryng it again but no luck, what i do instead always is spawn lot of layers and move objects around on them that way the ordering works. But its not always a solution of course. If you find a way to do it on a single layer let me know i want to know also ;)

Participate now!

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