Skip to content

5. Creating a New Object

Triangly edited this page Sep 6, 2024 · 3 revisions

As mentioned in the c_object chapter, any object that needs to be managed by the framework must inherit from c_object.

Step 1: Set up Inheritance

After creating a new object, the first step is to set it up to inherit from c_object:

chapter5_image1

Step 2: Modify the Create Event

Once inherited, the object will automatically include four events from c_object. In most cases, the only event you'll need to adjust is the Create Event, where you'll initialise the object. To do this:

  1. Right-click on the Create Event.
  2. Select Inherit Event.

chapter5_image2

Step 3: Add Initialisation Code

Now the object is ready! After calling event_inherited(), you can add your own initialisation logic.

Important: as explained in the culling section, by default, the object’s culling type is set to CULLING.ACTIVE. This may impact performance if many instances of this object are present in the room, so remember to adjust the culling type according to your needs!

chapter5_image3