Parent Child Help please

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 have been learning to better optimize my eventing and do things in simpler ways. I used to use many events to get enemy health bars above and to be destroyed when fighting an enemy. Using the parent child feature I have simplified this except... Probably super simple to do.. When I destroy the parent object and the health bars, every health bar instance gets destroyed. Maybe I am just not understanding the proper was to use parent/child. Any help would be great. Look at attached example.

  • Well I solved my own problem. I didn't know you simply had to destroy the parent to destroy the child objects. Funny how you think you know everything and yet you don't even know some of the simplest features of Fusion XD Anyways here is a completed example.

    This uses actives instead of counters and it will work with any number of instances of enemy objects.

    Each health bar has a container.

    Enemies use a group qualifier.

    Uses enemies max health vs current health to decide the percentage of the health counter filled.

    I hope this example helps some of our new clickers.

  • You're not actually destroying the health bars of the destroyed parents, they are just out of frame so they aren't visible, look at the debugger and see how one object is destroyed when you destroy a parent.
    I might mess around with this to see if this can be fixed.

    - BartekB

    Join the Click Converse Discord! - Please login to see this link.

  • Actually... Watching in the debugger it is not actually destroying the health actives so this is not yet resolved. Anyone have an idea how to destroy the health actives without the use of loops? Trying to keep it as simple as possible.

    DRINK COFFEE! Do stupid things faster and with more energy!

  • I hope Fusion 3 gets a better parenting feature, like folders and items inside it. A parent is a folder which can contain objects, which can also have items inside. If you clone or create the first parent, the children will get cloned / created with it. Similar to what Roblox does with its objects:
    Please login to see this picture.

    Roblox also has a feature for things to call their Parent to get their variables, like x and y and other things, which require no loops.

    Using a for each loop to attach objects to other objects for it to feel like a parent / child behaviour, is just a workaround for something Fusion doesn't have built in.

    - BartekB

    Join the Click Converse Discord! - Please login to see this link.

  • ^ definitely, +1 for parent/childs in F3 (I think I read something like that in the AMA though!)

    You can simply store some reference to health bars in the parent,
    and then filter those right before destroying:

    Please login to see this attachment.

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

  • Additional note:
    this would break if two or more enemies health goes <=0 within the same frame cycle
    (only two health bars objects would be destroyed instead of destroyed enemies*2)

    if you want to get rid of that (unlikely?) case you should add a simple foreach loop:

    health <=0
    >>> start loop foreach enemy

    on each enemy
    +fixed value of... = etc. etc.
    >>> do the destroy stuff as it is in the example now

    would add very very limited extra work for the processor as only enemies with health <=0 would be cycled by the foreach

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

Participate now!

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