How can I delete an object that I have created with Create Object?

0 favourites
  • 7 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I am creating objects with the Create object function... my problem is how can I tell it to destroy a certain object... because if I do the Destroy it destroys all of them... and I want to destroy a specific one.

  • Sounds like you are doing an Object Destroy without first selecting the object by using enough Conditions in your Event?

    These days if doing this through a Function, it should automatically remember the selected object through the interactions of Conditions within the Events. In the past, we needed to pass through the UID of the Object being interacted with.(in some instances)

    Without using a function, it should still keep track of which object instance is interacting with other objects. By using the Conditions for the Events to narrow down the Selected Objects List(SoL).

    I'm looking through the documentation. I could of sworn there is an area covering how the SoL works.

    EDIT: https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/events/how-events-work (Check out the section on that page, "Unreferenced objects")

    EDIT 2: That whole documentation page is worth reading through. It explains how the Events, and then Sub-Events narrow down which Object is being manipulated with the Actions of the Event.

    I hope this makes sense. I have horrible ADHD, and have a hard time putting conceptual ideas into words.

  • Thanks..

    I didn't understand how to do it... could you please explain it to me?

  • Thanks..

    I didn't understand how to do it... could you please explain it to me?

    The Documentation can really help, especially the link I left in my previous comment. Should bring you to the "How Events Work" Section. I have some trouble putting thoughts into words, but I'll do my best.

    Essentially the Conditions of each Event Block, will allow you to filter & narrow down which Object that Event is currently working with, and then manipulating through the use of Actions you are setting up inside that Event Block.

    The "Unreferenced objects" on the page in the Documentation, I linked you to explains the exact case you are facing with your issue. As you can see in the example image they put there. The Event Block does not have any Conditions on the left hand side to select which Monster is to be destroyed.

    Going by that example in the Documentation. If they added, a Condition to check if the Player Object is currently overlapping or colliding with the Monster. Then, it would only destroy the Monster Object being overlapped. But, since there are so few Conditions to filter out the object, all Monsters are destroyed. Because, they are only checking for a Spacebar being pressed, and "PowerupEnabled" instance variable on the Player Object. This filters it to ALL the Monster Objects, because all Monsters are within the Scope or SoL in the Event. It's very broad, and not narrowed down enough.

    I hope this makes some sense. You are trying to filter down the Objects as specific as you can, by using the Conditions in an Event. Then using the Actions of the Event, to alter the Object that is within the SoL of the Conditions.

    Another example, would be checking to see if a Bullet Object and a Monster Object are colliding, then destroy both using Actions. Then, anytime a Bullet collides with a Monster, it will destroy that Bullet and that Monster specifically. Because, they have been picked/selected using the Conditional block in the Event.

    I may have made that too confusing. I definitely recommend checking out that link above, and the Functions page in the Documentation will explain how a Function will select Objects. Think of a Function as a block of Events you need to use over and over. Rather than recreating that block of Events 30 times in Event Sheets. You can create a function once, then call it in other Event Sheets.

  • Sub-Events can filter down further, the Selected Objects List. The entire Events Section of the Documentation will help explain things further.

    https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/events

    I started off learning Construct like I do many things. By watching tutorials on YouTube. I've read through the Documentation twice. Besides the last two sections, "System reference", and "Scripting"

    I typically keep the Documentation open in a web browser tab, for use as a reference while I'm working on a project.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • thanks, I managed to delete it following your instructions

  • Right on :)

    I'm glad you figured it out. Whenever I'm working with something new, whether it's a game engine, programming language, digital painting app, etc, etc. I usually start off by following tutorials on YouTube.

    For example, when I came back to Construct 3, after several years of not using Construct 2. I needed to refresh my knowledge/skills with Construct. So I spent the first couple of weeks prototyping all different kinds of gameplay. By following video tutorials on YouTube.

    Then, from there. I moved on to creating my own projects, and read through the Documentation here on the Scirra website. Especially after being recommended by other members here, to at least read through the entire Documentation once. I ended up reading through it from beginning to end, two separate times. And, use it as reference when needed.

    Anyways. Below are some of the YouTube Channels I found helpful at the start. They have good series to walk through creating different types of games, and gameplay mechanics. They might help you out as well.

    https://www.youtube.com/@XanderwoodGameDev - Xanderwood, is good for beginners, to intermediate

    https://www.youtube.com/@gamedesignwithreilly - Game Design With Reilly, is on par with Xanderwood as far as difficulty. He mostly covers gameplay mechanics in short videos

    https://www.youtube.com/@Marlin-Gamedev - I haven't watched much of Marlin's videos. But, I have seen some of them pop up in my YouTube feed. He had a good 3D tutorial series going a while back, and covers other topics. You might find helpful

    https://www.youtube.com/@FoozleCC - FoozleCC, covers some great topics. Especially some of the more advanced things you can do in Construct

    I am sure there are many more folks on YouTube creating content around designing games within Construct 2/3. With all of these resources, and the official Construct Documentation you can't go wrong. Remember there are always many ways to achieve an end result. The more hours you put into your practice, the easier it becomes.

    Wishing you the best on your project(s)

    Happy Holidays :)

    EDIT: Other useful skills to learn along the way, are understanding how JavaScript works overall. Mathematics such as Algebra, and Trigonometry.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)