Interacting with a certain instance of an object (where there are duplicate objects)

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'm pretty sure this would apply to Fusion 2.5 also, but I am posting here cause I'm technically using MMF2. I would still be interested in knowing how to do this in Fusion 2.5 also. If you only work with Fusion 2.5, don't be afraid to answer cause I don't want this to go unnoticed simply because it's in the old category.

    I can't for the life of me figure out how to do this very simple thing. Neither can ChatGPT (well, it thinks that it can, but keeps screwing up). I believe I will need this kind of functionality often into the future, so it is important that I figure this out.

    So the problem is that I don't know how to address a particular instance of an object when there are duplicates. For example, I create a frame and place an active object on it. Now I duplicate this object many times. Now I have many instances of the same object (not to be confused with cloning the object - which actually creates another object in the list). In the events, I want to make it that when I press the left mouse button, I get the X and Y position (or other params) of a random instance of that object. Like picking the object at random and getting its X and Y pos. I am open to circumventing any Fusion limitations using XLua if possible.

    In the end, I am trying to make something where when the user clicks, it chooses a random instance of said object to do a particle effect on. So all I need is the X and Y cords of a random instance of this object.

    Here are some screenshots of my attempts working with ChatGPT.

    Here the counter is NOT being set to each new instance every time you click (as I would expect it to). Apparently Fusion can't address a particular instance of an object when the object being operated on is not the object itself (ie. it's the counter, not the Active).

    Please login to see this attachment.


    Here it's kinda working, although in a very junky way. Setting the Y pos here is forcing Fusion to bring the particular instance of the object into scope, so now I can finally access it into the counter. This is terrible though and I don't want to change the Y pos, but as soon as I change that line, it doesn't work. I thought I could fool it by just setting it back to itself - nope! How about "+0" - nope! It just has to change it. There has to be a cleaner way to do this. This is all convoluted.

    Please login to see this attachment.

  • WOW. I feel really dumb.

    -- Right click the object -> Pick or Count -> Pick [object name] at random

    Then as a sub-event:

    -- Mouse clicks with left button

    Then inside here, I can reference any property of the particular instance of the object and it works fine!

  • Some hint:

    1 use meaningful names for the alterable values. This way you know which variable is for

    2 each object you create, being at design- or at run-time, has an unique identifier called "Fixed Value". You may use it when you need to scope a single object, or to "connect" objects togheter. For instance, you may have a tank, and you want turn its turret indipendently. So, you may have two actives, one is the tank, the other the turret. Now you can "connect" them when you have, say, the tank with an alt. variable called turretFV, where you store the Fixed Value of the turret.

    Now, having selected a tank, you can scope the turret using a condition like "Fixed Value (Turret) = TurretFV(Tank).

    3 read this good article about scoping: Please login to see this link.

Participate now!

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