When I click on an Object, how can the objects behind it not be affected by the click?

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.
  • Hello, unfortunately this caused me a lot of trouble.


    When I click on an object, the object behind it is also affected by the click.

    For example: When I click on the object, it will be destroyed.

    Unfortunately, all the objects behind it are destroyed, so it thinks I clicked them all.

    How do I solve this?

  • Are you checking the mouse clicking against a qualifier ? Belong the two ( or more ) actives to the same qualifier ? This would explain the behaviour.
    In this particular case, you have to check for clicking on a single active, and not on a group ( that is, a qualifier or object copies ) of them.

    Does it make sense for you ?

    Furthermore, it is not easy to answer your question without seeing an example from you. Try to post here an .mfa file to show what you mean, this would help.

  • If you're using a qualifier an easy way to do this is with two events

    - While mouse pointer is over (qualifierobject) > set (some alterable value) to qualifier's fixed value

    - User clicks on (qualifier/object) and (some alterable value) = fixed ID of object/qualifier > perform the action

    Please login to see this picture.

  • Note that the above method only works because, by default, Fusion layers objects in the order they were created, and when using an object's fixed value (or any other property) to set any single value (such as the global value here), Fusion will also always pick the most recently created instance of that object (out of those which meet the other conditions - in this case, being under the mouse pointer).

    If you use events to change the display order of the objects (bring to front, send to back, etc), this will no longer work correctly, because the display order will no longer match the order of creation.

    A better solution, in that case, would be to use the Layer object, which would allow you to reliably solve the problem, without any extra events:

    + User clicks with left button on [Active]
    + Layer Object: [Active] At front?
    -> Active: Destroy

  • Both layer and object visibility is accounted for with the "object is visible" condition. You can use this to check for whether a button is available or not. Also, I use a "Master Menu Object" in which I store menu state data, and then use that data to rule in, or rule out objects with particular qualifiers if visibility is unavailable as a data point (meaning the object is visible, but I want it "unclickable"). Furthermore, I use "mouse pointer is NOT over", when ruling out one particular case where I need yet another exception. In general I think, having several things visible on each other that can be clicked, but then making it so that only one of those is available at a particular time, while another circumstance could have both clickable, wreaks of sub par design. Meaning it sounds like unappealing design, even if you could make it work technically.

    If the case is such that you use tiling or some sort of ordered layering that you want to remove sequentially, this must mean that you have a way of ordering the objects in the first place, and therefore would be able to print layer order data into an array; and if you are doing it in the editor as opposed to with code, you can use instance values to get this information. Then simply compare against the information to remove the top object. Also the new function "compare against minimum or maximum value" could be handy here.

    **EDIT**

    Just read marbenx answer, and if all you need is automatically detect the top object and delete only it on clicking, this is a really good way of doing it. I didn't even know mouse pointer is over, takes into consideration whether or not the hoverable object is actually visible at the point of hover.

Participate now!

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