Skip to main content

๐Ÿ”— Dependency System

The MakeIt3D plugin uses a dependency system that creates relationships between your Construct 3 objects and their 3D representations. Understanding this system is crucial for effectively managing 3D objects in your project.

๐Ÿ“‹ Overviewโ€‹

Instead of creating 3D objects directly, MakeIt3D uses placeholder objects from Construct 3 as references. This approach provides several advantages:

  • Unified Management: All 3D objects are tied to familiar Construct 3 objects
  • Multiple Instances: Create many 3D objects from a single placeholder
  • Easy Identification: Clear naming system for object tracking
  • Flexible Workflow: Use any Construct 3 object as a placeholder

๐ŸŽฏ How It Worksโ€‹

Placeholder Objectsโ€‹

A placeholder object can be:

  • Any object from your MakeIt3D plugin
  • Any existing Construct 3 object (Sprite, Text, etc.)
  • An empty object specifically created for 3D references
Best Practice

Create dedicated empty objects as placeholders to keep your project organized and avoid confusion with gameplay objects.

Unique ID Generationโ€‹

When you create a 3D object, MakeIt3D generates a unique identifier using this formula:

Unique ID = PlaceholderName + "_" + UID + "_" + InstanceID

Example: Hero_3_0

  • Hero = Placeholder object name
  • 3 = Object's UID in Construct 3
  • 0 = Instance ID you provide

๐Ÿ”ข Understanding the Componentsโ€‹

1. Placeholder Object Nameโ€‹

The name of your Construct 3 object that serves as the reference.

UID Location

// If your placeholder object is named "Hero"
PlaceholderName = "Hero"

2. UID (Unique Identifier)โ€‹

Every object in Construct 3 has a UID visible in the Properties panel.

UID Location

Finding UID

Select your object โ†’ Check the Properties panel โ†’ Look for the UID value (usually a number like 2, 3, 5, etc.)

3. Instance IDโ€‹

A number you provide when creating the 3D object to create multiple instances.

// Creating multiple instances of the same placeholder
InstanceID = 0 // First instance
InstanceID = 1 // Second instance
InstanceID = 2 // Third instance

๐ŸŽฎ Practical Examplesโ€‹

UID Location

Creating Multiple Charactersโ€‹

Let's say you have a placeholder object named "Hero" with UID 3:

// Create different enemy instances
CreateObject("Hero", 0) // Creates: Hero_3_0
CreateObject("Hero", 1) // Creates: Hero_3_1
CreateObject("Hero", 2) // Creates: Hero_3_2

Now you have three different 3D enemies, all based on the same placeholder!

Accessing Object Properties using expressionsโ€‹

To get the X position of a specific instance:

UID Location

// Get position X of Enemy_5_1
var posX = MakeIt3D.PositionX("Enemy_5_1");

// Breaking it down:
// "Enemy" = placeholder name
// "5" = UID from Construct 3
// "1" = instance ID

๐ŸŽฏ Using Conditionsโ€‹

Pick Object By Instance IDโ€‹

Use this condition to select a specific instance for actions:

  1. Action: Pick Object By Instance ID
  2. Parameters:
    • Placeholder Object: Select your reference object
    • Instance ID: Enter the instance number
// This selects Enemy_5_2 for subsequent actions
PickObjectByInstanceID(EnemyPlaceholder, 2)

UID Location UID Location UID Location After picking, you can perform actions like:

  • Change position
  • Modify materials
  • Update colors
  • Transform the object

๐Ÿ“ Best Practicesโ€‹

1. Organized Namingโ€‹

Use clear, descriptive names for placeholder objects:

โœ… Good: "PlayerCharacter", "Enemy_Orc", "Pickup_Coin"
โŒ Avoid: "Object1", "Temp", "Thing"

2. Instance ID Managementโ€‹

Keep track of your instance IDs:

// Use meaningful instance IDs
Player instances: 0
Enemy instances: 1-10
Pickups: 11-20
Environment: 21-30

3. Documentationโ€‹

Document your placeholder objects and their purposes:

PlaceholderUIDPurposeInstance Range
Hero3Player character0
Enemy_Goblin5Basic enemies1-5
Coin7Collectibles10-20

โš ๏ธ Common Issuesโ€‹

Issue: Object Not Foundโ€‹

Problem: MakeIt3D.PositionX("Hero_3_0") returns undefined

Solutions:

  1. โœ… Verify the placeholder object name matches exactly
  2. โœ… Check the UID in Properties panel
  3. โœ… Confirm the instance was created with ID 0
  4. โœ… Ensure the object exists before accessing properties

Issue: Wrong Object Selectedโ€‹

Problem: Actions affect the wrong 3D object

Solutions:

  1. โœ… Use "Pick Object By Instance ID" before actions
  2. โœ… Double-check your instance ID parameters
  3. โœ… Verify placeholder object reference is correct

๐Ÿš€ Advanced Usageโ€‹

Dynamic Instance Creationโ€‹

// Create enemies in a loop
for (let i = 0; i < enemyCount; i++) {
CreateObject("Enemy", i);
// Each enemy gets ID: Enemy_5_0, Enemy_5_1, Enemy_5_2...
}

Conditional Object Managementโ€‹

// Pick and modify specific instances
if (playerLevel > 5) {
PickObjectByInstanceID(BossPlaceholder, 0);
// Modify boss properties
}

๐Ÿ“Š Quick Referenceโ€‹

ComponentDescriptionExample
Unique ID FormatName_UID_InstanceIDHero_3_0
Creating ObjectsSpecify placeholder + instance IDCreateObject("Hero", 0)
Picking ObjectsUse condition with placeholder + instancePickObjectByInstanceID(Hero, 0)
Accessing PropertiesUse full unique ID in expressionsMakeIt3D.PositionX("Hero_3_0")

You're Ready!

With this dependency system, you can efficiently manage complex 3D scenes while maintaining clear relationships between your Construct 3 logic and 3D objects.