🧮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
utilsCreate a color from RGB values (0-255).
Parameters
Construct 3 Usage:
MakeIt3D.RGB(255, 128, 0)
Example:
Set object color to MakeIt3D.RGB(255, 0, 0) // Bright red
Vector3
utilsReturns a vector3 object with x, y, z values for 3D position, rotation, or scale.
Parameters
Construct 3 Usage:
MakeIt3D.Vector3(10, 5, -3)
Example:
Set position to MakeIt3D.Vector3(0, 10, 0) // 10 units above origin
Collisions & Triggers
SelfObjectId
collisionReturns 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
OtherObjectId
collisionReturns 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
TotalImpulse
collisionReturns 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")
ContactNormalsJson
collisionReturns a compact JSON string containing all contact normal vectors for the collision.
Construct 3 Usage:
MakeIt3D.ContactNormalsJson
Example:
Set debug_text to MakeIt3D.ContactNormalsJson
ContactPointsJson
collisionReturns 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
CollisionDataJson
collisionReturns 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
HasActiveContact
collisionReturns 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()
ContactPointsCount
collisionReturns the number of contact points generated in the most recent collision.
Construct 3 Usage:
MakeIt3D.ContactPointsCount
Example:
Log "Contact points: " & MakeIt3D.ContactPointsCount
CollisionDataBeautified
collisionReturns 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
Raycast
RaycastHitX
raycastReturns 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
RaycastHitY
raycastReturns 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
RaycastHitZ
raycastReturns 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
RaycastHitNormalX
raycastReturns 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
RaycastHitNormalY
raycastReturns 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
RaycastHitNormalZ
raycastReturns 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
RaycastObjectId
raycastReturns 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
RaycastDistance
raycastReturns 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()
RaycastJointId
raycastReturns joint ID if the hit object has any active joints attached to it.
Construct 3 Usage:
MakeIt3D.RaycastJointId
Example:
If MakeIt3D.RaycastJointId != "" Then HighlightJoint()
Objects (Rigidbody)
GetCurrentForeachObjectId
objectGet the object ID of the current object being iterated in a foreach loop.
Construct 3 Usage:
MakeIt3D.GetCurrentForeachObjectId
Example:
Log "Processing object: " & MakeIt3D.GetCurrentForeachObjectId
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