Skip to main content

🧮Expressions

Expressions retrieve data from your 3D scene and return values that can be used in Construct 3 events. They're perfect for getting positions, rotations, scene information, and more.

Object

🔧

RGB

utils
📊color

Create a color from RGB values (0-255).

Parameters

r
Red component (0-255)
g
Green component (0-255)
b
Blue component (0-255)

Construct 3 Usage:

MakeIt3D.RGB(255, 128, 0)

Example:

Set object color to MakeIt3D.RGB(255, 0, 0) // Bright red
Expression
🔧

Vector3

utils
📊vector3

Returns a vector3 object with x, y, z values for 3D position, rotation, or scale.

Parameters

x
X value of the vector3
y
Y value of the vector3
z
Z value of the vector3

Construct 3 Usage:

MakeIt3D.Vector3(10, 5, -3)

Example:

Set position to MakeIt3D.Vector3(0, 10, 0) // 10 units above origin
Expression

Collisions & Triggers

💥

SelfObjectId

collision
📝string

Returns the unique object ID of the object that is checking for the collision.

Construct 3 Usage:

MakeIt3D.SelfObjectId

Example:

Log "Collision detected on: " & MakeIt3D.SelfObjectId
Expression
💥

OtherObjectId

collision
📝string

Returns the unique object ID of the other object that was involved in the collision.

Construct 3 Usage:

MakeIt3D.OtherObjectId

Example:

Log "Collided with: " & MakeIt3D.OtherObjectId
Expression
💥

TotalImpulse

collision
🔢number

Returns the total impulse applied during the collision. Higher values indicate stronger impacts.

Construct 3 Usage:

MakeIt3D.TotalImpulse

Example:

If MakeIt3D.TotalImpulse > 100 Then PlaySound("crash")
Expression
💥

ContactNormalsJson

collision
📝string

Returns a compact JSON string containing all contact normal vectors for the collision.

Construct 3 Usage:

MakeIt3D.ContactNormalsJson

Example:

Set debug_text to MakeIt3D.ContactNormalsJson
Expression
💥

ContactPointsJson

collision
📝string

Returns a compact JSON string with all contact point data from the collision (positions, impulses, distances).

Construct 3 Usage:

MakeIt3D.ContactPointsJson

Example:

Log "Contact data: " & MakeIt3D.ContactPointsJson
Expression
💥

CollisionDataJson

collision
📝string

Returns a compact JSON string representing the full collision data (normals, contact points, impulses).

Construct 3 Usage:

MakeIt3D.CollisionDataJson

Example:

Save MakeIt3D.CollisionDataJson to collision_log
Expression
💥

HasActiveContact

collision
boolean

Returns true if there is at least one active contact point between the colliders in the last collision.

Construct 3 Usage:

MakeIt3D.HasActiveContact

Example:

If MakeIt3D.HasActiveContact Then ApplyFriction()
Expression
💥

ContactPointsCount

collision
🔢number

Returns the number of contact points generated in the most recent collision.

Construct 3 Usage:

MakeIt3D.ContactPointsCount

Example:

Log "Contact points: " & MakeIt3D.ContactPointsCount
Expression
💥

CollisionDataBeautified

collision
📝string

Returns a human-readable JSON string of the full collision data. Useful for debugging.

Construct 3 Usage:

MakeIt3D.CollisionDataBeautified

Example:

Display MakeIt3D.CollisionDataBeautified in debug panel
Expression

Raycast

RaycastHitX

raycast
🔢number

Returns the X coordinate of the 3D point where the last raycast hit occurred.

Construct 3 Usage:

MakeIt3D.RaycastHitX

Example:

Set marker_x to MakeIt3D.RaycastHitX
Expression

RaycastHitY

raycast
🔢number

Returns the Y coordinate of the 3D point where the last raycast hit occurred.

Construct 3 Usage:

MakeIt3D.RaycastHitY

Example:

Set marker_y to MakeIt3D.RaycastHitY
Expression

RaycastHitZ

raycast
🔢number

Returns the Z coordinate of the 3D point where the last raycast hit occurred.

Construct 3 Usage:

MakeIt3D.RaycastHitZ

Example:

Set marker_z to MakeIt3D.RaycastHitZ
Expression

RaycastHitNormalX

raycast
🔢number

Returns the X component of the surface normal at the 3D point where the last raycast hit occurred.

Construct 3 Usage:

MakeIt3D.RaycastHitNormalX

Example:

Set surface_normal_x to MakeIt3D.RaycastHitNormalX
Expression

RaycastHitNormalY

raycast
🔢number

Returns the Y component of the surface normal at the 3D point where the last raycast hit occurred.

Construct 3 Usage:

MakeIt3D.RaycastHitNormalY

Example:

Set surface_normal_y to MakeIt3D.RaycastHitNormalY
Expression

RaycastHitNormalZ

raycast
🔢number

Returns the Z component of the surface normal at the 3D point where the last raycast hit occurred.

Construct 3 Usage:

MakeIt3D.RaycastHitNormalZ

Example:

Set surface_normal_z to MakeIt3D.RaycastHitNormalZ
Expression

RaycastObjectId

raycast
📝string

Returns the app-specific ID of the object that was hit by the last raycast.

Construct 3 Usage:

MakeIt3D.RaycastObjectId

Example:

Log "Hit object: " & MakeIt3D.RaycastObjectId
Expression

RaycastDistance

raycast
🔢number

Returns the distance from the camera to the point where the last raycast hit occurred.

Construct 3 Usage:

MakeIt3D.RaycastDistance

Example:

If MakeIt3D.RaycastDistance < 10 Then ShowInteractPrompt()
Expression

RaycastJointId

raycast
📝string

Returns joint ID if the hit object has any active joints attached to it.

Construct 3 Usage:

MakeIt3D.RaycastJointId

Example:

If MakeIt3D.RaycastJointId != "" Then HighlightJoint()
Expression

Objects (Rigidbody)

📦

GetCurrentForeachObjectId

object
📝string

Get the object ID of the current object being iterated in a foreach loop.

Construct 3 Usage:

MakeIt3D.GetCurrentForeachObjectId

Example:

Log "Processing object: " & MakeIt3D.GetCurrentForeachObjectId
Expression

Usage Guidelines

Return Types Guide

  • 🔢 Number - Numeric values (positions, rotations, counts, distances)
  • 📝 String - Text values (object IDs, file paths, error messages)
  • ✓ Boolean - True/false values (loaded states, visibility checks)
  • 📋 Object - Complex data structures (rarely used)

Best Practices

  • Cache Values - Store frequently accessed expressions in variables
  • Use in Comparisons - Perfect for System Compare conditions
  • Update Displays - Great for updating UI text with real-time data
  • Performance - Expressions are fast but avoid calling them every tick unnecessarily

Common Patterns

// Update UI with object position
Every Tick -> Set Text to "X: " & MakeIt3D.GetObjectPositionX("player")

// Check distance for gameplay
System Compare: MakeIt3D.GetDistanceBetween("player", "goal") < 2
-> Go to next layout

// Monitor performance
MakeIt3D.GetFPS() < 30 -> Enable performance mode