🧮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 redVector3
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 originCollisions & Triggers
SelfObjectId
collisionReturns the unique object ID of the object that is checking for the collision.
Construct 3 Usage:
MakeIt3D.SelfObjectIdExample:
Log "Collision detected on: " & MakeIt3D.SelfObjectIdOtherObjectId
collisionReturns the unique object ID of the other object that was involved in the collision.
Construct 3 Usage:
MakeIt3D.OtherObjectIdExample:
Log "Collided with: " & MakeIt3D.OtherObjectIdTotalImpulse
collisionReturns the total impulse applied during the collision. Higher values indicate stronger impacts.
Construct 3 Usage:
MakeIt3D.TotalImpulseExample:
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.ContactNormalsJsonExample:
Set debug_text to MakeIt3D.ContactNormalsJsonContactPointsJson
collisionReturns a compact JSON string with all contact point data from the collision (positions, impulses, distances).
Construct 3 Usage:
MakeIt3D.ContactPointsJsonExample:
Log "Contact data: " & MakeIt3D.ContactPointsJsonCollisionDataJson
collisionReturns a compact JSON string representing the full collision data (normals, contact points, impulses).
Construct 3 Usage:
MakeIt3D.CollisionDataJsonExample:
Save MakeIt3D.CollisionDataJson to collision_logHasActiveContact
collisionReturns true if there is at least one active contact point between the colliders in the last collision.
Construct 3 Usage:
MakeIt3D.HasActiveContactExample:
If MakeIt3D.HasActiveContact Then ApplyFriction()ContactPointsCount
collisionReturns the number of contact points generated in the most recent collision.
Construct 3 Usage:
MakeIt3D.ContactPointsCountExample:
Log "Contact points: " & MakeIt3D.ContactPointsCountCollisionDataBeautified
collisionReturns a human-readable JSON string of the full collision data. Useful for debugging.
Construct 3 Usage:
MakeIt3D.CollisionDataBeautifiedExample:
Display MakeIt3D.CollisionDataBeautified in debug panelRaycast
RaycastHitX
raycastReturns the X coordinate of the 3D point where the last raycast hit occurred.
Construct 3 Usage:
MakeIt3D.RaycastHitXExample:
Set marker_x to MakeIt3D.RaycastHitXRaycastHitY
raycastReturns the Y coordinate of the 3D point where the last raycast hit occurred.
Construct 3 Usage:
MakeIt3D.RaycastHitYExample:
Set marker_y to MakeIt3D.RaycastHitYRaycastHitZ
raycastReturns the Z coordinate of the 3D point where the last raycast hit occurred.
Construct 3 Usage:
MakeIt3D.RaycastHitZExample:
Set marker_z to MakeIt3D.RaycastHitZRaycastHitNormalX
raycastReturns the X component of the surface normal at the 3D point where the last raycast hit occurred.
Construct 3 Usage:
MakeIt3D.RaycastHitNormalXExample:
Set surface_normal_x to MakeIt3D.RaycastHitNormalXRaycastHitNormalY
raycastReturns the Y component of the surface normal at the 3D point where the last raycast hit occurred.
Construct 3 Usage:
MakeIt3D.RaycastHitNormalYExample:
Set surface_normal_y to MakeIt3D.RaycastHitNormalYRaycastHitNormalZ
raycastReturns the Z component of the surface normal at the 3D point where the last raycast hit occurred.
Construct 3 Usage:
MakeIt3D.RaycastHitNormalZExample:
Set surface_normal_z to MakeIt3D.RaycastHitNormalZRaycastObjectId
raycastReturns the app-specific ID of the object that was hit by the last raycast.
Construct 3 Usage:
MakeIt3D.RaycastObjectIdExample:
Log "Hit object: " & MakeIt3D.RaycastObjectIdRaycastDistance
raycastReturns the distance from the camera to the point where the last raycast hit occurred.
Construct 3 Usage:
MakeIt3D.RaycastDistanceExample:
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.RaycastJointIdExample:
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.GetCurrentForeachObjectIdExample:
Log "Processing object: " & MakeIt3D.GetCurrentForeachObjectIdUsage 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