From af95d7b82edb5975205717eb224a28bc6a8bf00b Mon Sep 17 00:00:00 2001 From: pukosnds Date: Sat, 20 Jun 2026 19:14:17 +0000 Subject: [PATCH] Automated Extension submission for issue #2161 --- extensions/community/FP3D.json | 9067 ++++++++++++++++++++++++++++++++ 1 file changed, 9067 insertions(+) create mode 100644 extensions/community/FP3D.json diff --git a/extensions/community/FP3D.json b/extensions/community/FP3D.json new file mode 100644 index 000000000..9c55c24cd --- /dev/null +++ b/extensions/community/FP3D.json @@ -0,0 +1,9067 @@ +{ + "author": "", + "category": "Game mechanic", + "dimension": "3D", + "extensionNamespace": "", + "fullName": "Forces And Positions 3D (FP3D)", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWF4aXMtYXJyb3ciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIsMkwxNiw2SDEzVjEzLjg1TDE5LjUzLDE3LjYxTDIxLDE1LjAzTDIyLjUsMjAuNUwxNywyMS45NkwxOC41MywxOS4zNUwxMiwxNS41OEw1LjQ3LDE5LjM1TDcsMjEuOTZMMS41LDIwLjVMMywxNS4wM0w0LjQ3LDE3LjYxTDExLDEzLjg1VjZIOEwxMiwyWiIgLz48L3N2Zz4=", + "name": "FP3D", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/e2314b6adb780c72b1332a13d17abb17458ebb9c8fbecbbdd6cc2d4127178df2_axis-arrow.svg", + "shortDescription": "Adds functions for 3D space such as Forces, Overlay, Constraints, Attatchments, viewmodel and more.", + "version": "1.0.0", + "description": [ + "CONTAINS BASIC AND COMPLEX FUNCTIONS.", + "Functions such as:", + "- applying impulses and forces to objects with physics", + "", + "- attatch objects to other objects or in front of the camera", + "", + "- convert the normal of an intersection from a raycast into angles.", + "", + "- convert the 3D position onto a 2D plane with optional functions such as scaling down or making the icon orbit the screen if the target position is behind the camera", + "", + "- camera collision for third-person games", + "", + "- behaviors that automate or facilitate processes, like SnapToGrid or FPS Parenting.", + "", + "- condition that checks whether an object or the camera is looking at a target.", + "", + "- function to get the object closest to the center of the camera" + ], + "tags": [ + "3d", + "parent", + "forces" + ], + "authorIds": [ + "n4hGQoIPV1f6gSQY4f2aqsDB2gD3" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Applies an instantaneous 3D physical force (impulse) to an object using spherical angles (2D direction and 3D elevation).", + "fullName": "Apply Impulse", + "functionType": "Action", + "group": "Forces", + "name": "Impulse", + "sentence": "Apply an impulse with force _PARAM5_ at the object _PARAM1_ at the angle _PARAM3_ and elevation _PARAM4_ with physics", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::ApplyImpulseAtCenter" + }, + "parameters": [ + "Object", + "Physics3D", + "force* cos(ToRad(Angle2D)) * cos(ToRad(Angle3D))", + "force* sin(ToRad(Angle2D)) * cos(ToRad(Angle3D))", + "force* sin(ToRad(-Angle3D))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Target object (objectList)", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "Horizontal angle (Yaw) in degrees", + "name": "Angle2D", + "type": "expression" + }, + { + "description": "Vertical elevation (Pitch) in degrees", + "name": "Angle3D", + "type": "expression" + }, + { + "description": "Magnitude of the impulse", + "name": "force", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Applies an instantaneous 3D physical force (impulse) to an object towards an position.", + "fullName": "Apply Impulse Towards Position", + "functionType": "Action", + "group": "Forces", + "name": "ImpulseTowardsPosition", + "sentence": "Apply impulse at _PARAM1_ with force _PARAM3_ towards position _PARAM5_;_PARAM6_;_PARAM7_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Distance", + "=", + "FP3D::Distance(Object.CenterX(), Object.CenterY(), Object.Object3D::CenterZ(), PositionX, PositionY, PositionZ)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::ApplyImpulseAtCenter" + }, + "parameters": [ + "Object", + "Physics3D", + "force * (PositionX - Object.CenterX()) / Distance", + "force * (PositionY - Object.CenterY()) / Distance", + "force * (PositionZ - Object.Object3D::CenterZ()) / Distance" + ] + } + ] + } + ], + "variables": [ + { + "name": "angle", + "type": "number", + "value": 0 + }, + { + "name": "Distance", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Target object (objectList)", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "Magnitude of the impulse", + "name": "force", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Position in X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Position in Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Position in Z axis", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Applies an instantaneous physical impulse at a specific point in 3D space. Because the force can be applied away from the object's center of mass, this function can generate both linear movement and angular velocity (spinning/torque).", + "fullName": "Apply Impulse at Point", + "functionType": "Action", + "group": "Forces", + "name": "ImpulseAtPoint", + "sentence": "Apply an impulse with force _PARAM5_ at the object _PARAM1_ at the angle _PARAM3_ and elevation _PARAM4_ with physics at point _PARAM7_, _PARAM8_, _PARAM9_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::ApplyImpulse" + }, + "parameters": [ + "Object", + "Physics3D", + "force* cos(ToRad(Angle2D)) * cos(ToRad(Angle3D))", + "force* sin(ToRad(Angle2D)) * cos(ToRad(Angle3D))", + "force* sin(ToRad(-Angle3D))", + "PointX", + "PointY", + "PointZ" + ] + } + ] + } + ], + "parameters": [ + { + "description": "The object to which the impulse will be applied", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "The horizontal angle (Yaw) in degrees", + "name": "Angle2D", + "type": "expression" + }, + { + "description": "The vertical elevation (Pitch) in degrees", + "name": "Angle3D", + "type": "expression" + }, + { + "description": "The strength/magnitude of the impulse", + "name": "force", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "The X coordinate of the impact point in world space", + "name": "PointX", + "type": "expression" + }, + { + "description": "The Y coordinate of the impact point in world space", + "name": "PointY", + "type": "expression" + }, + { + "description": "The Z coordinate of the impact point in world space", + "name": "PointZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Apply an continuous force at the center of object.", + "fullName": "Apply Linear Force (non physics)", + "functionType": "Action", + "group": "Forces", + "name": "ForceLinear", + "sentence": "Apply an linear force _PARAM5_ at the object _PARAM1_ at the angle _PARAM3_ and elevation _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object", + "+", + "Force * cos(ToRad(Angle)) * cos(ToRad(ElevationAngle))", + "+", + "Force * sin(ToRad(Angle)) * cos(ToRad(ElevationAngle))" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "Force * sin(ToRad(-ElevationAngle))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object to be pushed", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Horizontal angle", + "name": "Angle", + "type": "expression" + }, + { + "description": "Vertical angle", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Amount of force", + "name": "Force", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Applies a continuous 3D force to the object's center towards a specific position.", + "fullName": "Apply Linear Force Towards an Position", + "functionType": "Action", + "group": "Forces", + "name": "ForceLinearTowardsPosition", + "sentence": "Apply a force of _PARAM3_ to _PARAM1_ towards _PARAM5_, _PARAM6_, _PARAM7_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Distance", + "=", + "FP3D::Distance(Object.CenterX(), Object.CenterY(), Object.Object3D::CenterZ(), PositionX, PositionY, PositionZ)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object", + "+", + "Force * (PositionX - Object.CenterX()) / Distance", + "+", + "Force * (PositionY - Object.CenterY()) / Distance" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "(Force * (PositionZ - Object.Object3D::CenterZ()) / Distance)" + ] + } + ] + } + ], + "variables": [ + { + "name": "angle", + "type": "number", + "value": 0 + }, + { + "name": "Distance", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "The object that will receive the force", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "The magnitude of the force (acceleration depends on object mass)", + "name": "Force", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Target position in X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Target position in Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Target position in Z axis", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Apply forces to an object changing its linear velocity.", + "fullName": "Apply Velocity Force", + "functionType": "Action", + "group": "Forces", + "name": "ForceLinearPhysics", + "sentence": "Push _PARAM1_ with _PARAM6_ force at angle _PARAM4_° and tilt _PARAM5_° (additive? _PARAM7_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Additive", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityX" + }, + "parameters": [ + "Object", + "Physics3D", + "+", + "Force * cos(ToRad(Angle)) * cos(ToRad(ElevationAngle))" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityY" + }, + "parameters": [ + "Object", + "Physics3D", + "+", + "Force * sin(ToRad(Angle)) * cos(ToRad(ElevationAngle))" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityZ" + }, + "parameters": [ + "Object", + "Physics3D", + "+", + "Force * sin(ToRad(-ElevationAngle))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Additive", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityX" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "Force * cos(ToRad(Angle)) * cos(ToRad(ElevationAngle))" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityY" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "Force * sin(ToRad(Angle)) * cos(ToRad(ElevationAngle))" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityZ" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "Force * sin(ToRad(-ElevationAngle))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object to be pushed", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "Horizontal Angle", + "name": "Angle", + "type": "expression" + }, + { + "description": "Vertical Angle", + "name": "ElevationAngle", + "type": "expression" + }, + { + "description": "Force Amount", + "name": "Force", + "type": "expression" + }, + { + "description": "Constantly increase by the force", + "longDescription": "yes = adding force\nno = constant force", + "name": "Additive", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Applies a continuous 3D physical force to the object's center of mass using spherical coordinates. This is ideal for modeling constant acceleration, such as a rocket engine, a constant wind, or a magnetic pull.", + "fullName": "Apply Force", + "functionType": "Action", + "group": "Forces", + "name": "Force", + "sentence": "Apply an force _PARAM5_ at the object _PARAM1_ at the angle _PARAM3_ and elevation _PARAM4_ witth physics", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::ApplyForceAtCenter" + }, + "parameters": [ + "Object", + "Physics3D", + "force* cos(ToRad(Angle2D)) * cos(ToRad(Angle3D))", + "force* sin(ToRad(Angle2D)) * cos(ToRad(Angle3D))", + "force* sin(ToRad(-Angle3D))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "The object that will receive the force", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "The horizontal angle (Yaw) in degrees", + "name": "Angle2D", + "type": "expression" + }, + { + "description": "The vertical elevation (Pitch) in degrees", + "name": "Angle3D", + "type": "expression" + }, + { + "description": "The magnitude of the force (acceleration depends on object mass)", + "name": "force", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Applies a continuous 3D physical force to the object's center of mass towards a specific position.", + "fullName": "Apply Force Towards an Position", + "functionType": "Action", + "group": "Forces", + "name": "ForceTowardsPosition", + "sentence": "Apply a force of _PARAM3_ to _PARAM1_ towards _PARAM5_, _PARAM6_, _PARAM7_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Distance", + "=", + "FP3D::Distance(Object.CenterX(), Object.CenterY(), Object.Object3D::CenterZ(), PositionX, PositionY, PositionZ)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::ApplyForceAtCenter" + }, + "parameters": [ + "Object", + "Physics3D", + "force * (PositionX - Object.CenterX()) / Distance", + "force * (PositionY - Object.CenterY()) / Distance", + "force * (PositionZ - Object.Object3D::CenterZ()) / Distance" + ] + } + ] + } + ], + "variables": [ + { + "name": "angle", + "type": "number", + "value": 0 + }, + { + "name": "Distance", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "The object that will receive the force", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "The magnitude of the force (acceleration depends on object mass)", + "name": "force", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Target position on X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Target position on Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Target position on Z axis", + "name": "PositionZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Applies an physical Force at a specific point in 3D space. Because the force can be applied away from the object's center of mass, this function can generate both linear movement and angular velocity (spinning/torque).", + "fullName": "Apply Force at Point", + "functionType": "Action", + "group": "Forces", + "name": "ForceAtPoint", + "sentence": "Apply an impulse with force _PARAM5_ at the object _PARAM1_ at the angle _PARAM3_ and elevation _PARAM4_ with physics at point _PARAM7_, _PARAM8_, _PARAM9_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::ApplyForce" + }, + "parameters": [ + "Object", + "Physics3D", + "force* cos(ToRad(Angle2D)) * cos(ToRad(Angle3D))", + "force* sin(ToRad(Angle2D)) * cos(ToRad(Angle3D))", + "force* sin(ToRad(-Angle3D))", + "PointX", + "PointY", + "PointZ" + ] + } + ] + } + ], + "parameters": [ + { + "description": "The object to which the impulse will be applied", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "The horizontal angle (Yaw) in degrees", + "name": "Angle2D", + "type": "expression" + }, + { + "description": "The vertical elevation (Pitch) in degrees", + "name": "Angle3D", + "type": "expression" + }, + { + "description": "The strength/magnitude of the impulse", + "name": "force", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "The X coordinate of the impact point in world space", + "name": "PointX", + "type": "expression" + }, + { + "description": "The Y coordinate of the impact point in world space", + "name": "PointY", + "type": "expression" + }, + { + "description": "The Z coordinate of the impact point in world space", + "name": "PointZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Handles colision between camera and an wall and move the camera towards an focal object. ", + "fullName": "Separate camera from object", + "functionType": "Action", + "group": "Position", + "name": "CameraAway", + "sentence": "Separate camera from _PARAM1_ focusing in _PARAM3_. (max distance: _PARAM2_. Distance Offset: _PARAM4_)", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// Since i don't want to make this extension too dependent of another i'm using local raycasts", + "", + "const allObstacles = eventsFunctionContext.getObjects(\"Object\"); ", + "const fobj = eventsFunctionContext.getObjects(\"FocalObject\")[0];", + "const distMax = eventsFunctionContext.getArgument(\"RayDistance\");", + "const off = eventsFunctionContext.getArgument(\"Offset\")", + "", + "const tc = runtimeScene.getLayer(\"\").getRenderer().getThreeCamera()", + "", + "if (allObstacles.length > 0 && fobj) {", + " const fobj3d = fobj.get3DRendererObject();", + " ", + " const objectsToTest = [];", + " allObstacles.forEach((obj) => {", + " const mesh = obj.get3DRendererObject();", + " if (mesh) {", + " mesh.updateMatrixWorld(true); ", + " objectsToTest.push(mesh);", + " }", + " });", + "", + " const origin = new THREE.Vector3();", + " const boundingBox = new THREE.Box3().setFromObject(fobj3d);", + " boundingBox.getCenter(origin); ", + "", + " const targetPos = new THREE.Vector3().copy(tc.position);", + " const direction = new THREE.Vector3().subVectors(targetPos, origin);", + " const distanceToTarget = direction.length();", + " direction.normalize();", + "", + " const raycaster = new THREE.Raycaster(origin, direction, 0.7, distMax);", + " const intersects = raycaster.intersectObjects(objectsToTest, true);", + "", + " if (intersects.length > 0) {", + " const hit = intersects[0];", + " ", + " const safePoint = hit.point.clone().addScaledVector(direction, -off);", + " ", + " tc.position.lerp(safePoint, 1);", + " }", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The Wall", + "name": "Object", + "type": "objectList" + }, + { + "description": "Maximum Raycast distance", + "name": "RayDistance", + "type": "expression" + }, + { + "description": "The focused object that the camera will be near on", + "name": "FocalObject", + "type": "objectList" + }, + { + "description": "The distance from the intersection", + "name": "Offset", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Returns an Distance between an Focal Point Object and an Wall, useful for Camera Colisions.", + "fullName": "Distance between focal point and intersection", + "functionType": "Expression", + "group": "Position", + "name": "CamColisionDist", + "sentence": "Separate camera from _PARAM1_ focusing in _PARAM3_. (max distance: _PARAM2_)", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "// copypasted from the PutCameraAway action. i don't want to make the user to download other extensions so i'm using simple local raycast instead.", + "", + "const allObstacles = eventsFunctionContext.getObjects(\"Object\"); ", + "const fobj = eventsFunctionContext.getObjects(\"FocalObject\")[0];", + "const maxDistance = eventsFunctionContext.getArgument(\"MaxDistance\");", + "const off = eventsFunctionContext.getArgument(\"Offset\")", + "", + "const tc = runtimeScene.getLayer(\"\").getRenderer().getThreeCamera();", + "", + "", + "if (allObstacles.length > 0 && fobj) {", + " const fobj3d = fobj.get3DRendererObject();", + " const objectsToTest = [];", + " ", + " allObstacles.forEach((obj) => {", + " const mesh = obj.get3DRendererObject();", + " if (mesh) {", + " mesh.updateMatrixWorld(true); ", + " objectsToTest.push(mesh);", + " }", + " });", + "", + " const origin = new THREE.Vector3();", + " const boundingBox = new THREE.Box3().setFromObject(fobj3d);", + " boundingBox.getCenter(origin); ", + " ", + " const targetPos = new THREE.Vector3().copy(tc.position);", + " const direction = new THREE.Vector3().subVectors(targetPos, origin).normalize();", + "", + " const raycaster = new THREE.Raycaster(origin, direction, 0.7, maxDistance);", + " const intersects = raycaster.intersectObjects(objectsToTest, true);", + "", + " if (intersects.length > 0) {", + " eventsFunctionContext.returnValue = intersects[0].distance - off;", + " } else {", + " eventsFunctionContext.returnValue = maxDistance;", + " }", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Wall, the object to be avoided", + "name": "Object", + "type": "objectList" + }, + { + "description": "The focal point where for the camera to get near on", + "name": "FocalObject", + "type": "objectList" + }, + { + "description": "Maximum Distance of the Raycast", + "name": "MaxDistance", + "type": "expression" + }, + { + "description": "How far from intersection camera will stay", + "name": "Offset", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "deprecationMessage": "this expression might be useless, use PutInFront() instead.", + "description": "Calculates and give you the exact X, Y, or Z coordinate of a point relative to a target object, accounting for that object's full 3D rotation. This is perfect for finding where a \"gun barrel\" or \"attachment point\" should be in 3D space, even as the object tilts and turns.", + "fullName": "Attatchement Position", + "functionType": "Expression", + "group": "InnerFunctions", + "name": "AttatchPos", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "defining angles this is for an more readable equation" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "cosA", + "=", + "cos(ToRad(TargetAngle))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "cosRX", + "=", + "cos(ToRad(TargetRotationX))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "cosRY", + "=", + "cos(ToRad(TargetRotationY))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "sinA", + "=", + "sin(ToRad(TargetAngle))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "sinRX", + "=", + "sin(ToRad(TargetRotationX))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "sinRY", + "=", + "sin(ToRad(TargetRotationY))" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "equations\n\nX = targetX + \n (dist * (cosA * cosRY)) + \n (hOff * (cosA * sinRY * sinRX - sinA * cosRX)) + \n (vertOff * (cosA * sinRY * cosRX + sinA * sinRX))\n\nY = targetY + \n (dist * (sinA * cosRY)) + \n (hOff * (sinA * sinRY * sinRX + cosA * cosRX)) + \n (vertOff * (sinA * sinRY * cosRX - cosA * sinRX))\n\nZ = targetZ - \n (dist * sinRY) + \n (hOff * cosRY * sinRX) + \n (vertOff * cosRY * cosRX)\n" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "X", + "=", + "TargetPositionX + (Distance * (cosA * cosRY)) + (HorizontalOffset * (cosA * sinRY * sinRX - sinA * cosRX)) + (VerticalOffset * (cosA * sinRY * cosRX + sinA * sinRX))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Y", + "=", + "TargetPositionY + (Distance * (sinA * cosRY)) + (HorizontalOffset * (sinA * sinRY * sinRX + cosA * cosRX)) + (VerticalOffset * (sinA * sinRY * cosRX - cosA * sinRX))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Z", + "=", + "TargetPositionZ - (Distance * sinRY) + (HorizontalOffset * cosRY * sinRX) + (VerticalOffset * cosRY * cosRX)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "returning" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"X\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "X" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"Y\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Y" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"Z\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Z" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "X", + "type": "number", + "value": 0 + }, + { + "name": "Y", + "type": "number", + "value": 0 + }, + { + "name": "Z", + "type": "number", + "value": 0 + }, + { + "name": "cosA", + "type": "number", + "value": 0 + }, + { + "name": "cosRY", + "type": "number", + "value": 0 + }, + { + "name": "cosRX", + "type": "number", + "value": 0 + }, + { + "name": "sinA", + "type": "number", + "value": 0 + }, + { + "name": "sinRX", + "type": "number", + "value": 0 + }, + { + "name": "sinRY", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Target position in X axis", + "name": "TargetPositionX", + "type": "expression" + }, + { + "description": "Target position in Y axis", + "name": "TargetPositionY", + "type": "expression" + }, + { + "description": "Target position in Z axis", + "name": "TargetPositionZ", + "type": "expression" + }, + { + "description": "Target horizontal angle", + "name": "TargetAngle", + "type": "expression" + }, + { + "description": "Target vertical angle", + "name": "TargetRotationX", + "type": "expression" + }, + { + "description": "Target roll angle (commonly RotationX for objects)", + "name": "TargetRotationY", + "type": "expression" + }, + { + "description": "Forward distance", + "name": "Distance", + "type": "expression" + }, + { + "description": "Horizontal Distance", + "name": "HorizontalOffset", + "type": "expression" + }, + { + "description": "Vertical Distance", + "name": "VerticalOffset", + "type": "expression" + }, + { + "description": "Choose \"X\", \"Y\", or \"Z\" to get that specific coordinate", + "name": "Return", + "supplementaryInformation": "[\"X\",\"Y\",\"Z\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Coordinates an object's position and rotation to match the camera's view. It allows for 3D offsets (Horizontal, Vertical, and Distance) and provides smooth interpolation for both movement and rotation to simulate \"viewmodel sway\" or \"weight\".", + "fullName": "Put Object in front of Camera", + "functionType": "Action", + "group": "Position", + "name": "PositioningCamera", + "sentence": "Put _PARAM1_ in front of camera. Vertical Position in projection: _PARAM2_. Horizontal Position in projection _PARAM3_ and an Distance of _PARAM4_. -- Position Lerp(_PARAM6_) -- Follow Angle? _PARAM7_. Angular Lerp(_PARAM8_) -- Angle Offset: _PARAM9_. RotationY Offset: _PARAM10_. RotationX Offset: _PARAM11_. Enable: Rotation? _PARAM12_;RotationX? _PARAM13_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "x", + "=", + "FP3D::AttatchPos(CameraCenterX(), CameraCenterY(), Scene3D::CameraZ(), CameraAngle()+90, Scene3D::CameraRotationY(), Scene3D::CameraRotationX()+90, Distance, -HorizontalOffset, -VerticalOffset, \"X\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "y", + "=", + "FP3D::AttatchPos(CameraCenterX(), CameraCenterY(), Scene3D::CameraZ(), CameraAngle()+90, Scene3D::CameraRotationY(), Scene3D::CameraRotationX()+90, Distance, -HorizontalOffset, -VerticalOffset, \"Y\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "z", + "=", + "FP3D::AttatchPos(CameraCenterX(), CameraCenterY(), Scene3D::CameraZ(), CameraAngle()+90, Scene3D::CameraRotationY(), Scene3D::CameraRotationX()+90, Distance, -HorizontalOffset, -VerticalOffset, \"Z\")" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Orientation" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "a", + "=", + "CameraAngle(Object.Layer())+90" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "rx", + "=", + "Scene3D::CameraRotationY(Object.Layer())" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ry", + "=", + "Scene3D::CameraRotationX(Object.Layer()) + 90" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "no smoothness" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "lerp", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object", + "=", + "x", + "=", + "y" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "z" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "smoothness" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "lerp", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "lerpp", + "=", + "lerp" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object", + "=", + "lerp(Object.CenterX(), x, lerp)", + "=", + "lerp(Object.CenterY(), y, lerp)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "lerp(Object.Object3D::CenterZ(), z, lerp)" + ] + } + ] + } + ], + "variables": [ + { + "name": "lerpp", + "type": "number", + "value": 0 + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "follow angles and apply offsets" + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "FollowAngles", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "angularLerp", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "a" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ApplyRotY", + "True", + "\"Yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "ry" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ApplyRotX", + "True", + "\"Yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "rx" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "angularLerp", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "lerpAngle(Object.Angle(), a, angularLerp)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ApplyRotY", + "True", + "\"Yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "lerpAngle(Object.Object3D::RotationY(), ry, angularLerp)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ApplyRotX", + "True", + "\"Yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "lerpAngle(Object.Object3D::RotationX(), rx, angularLerp)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "using the get3Drenderer.rotate to apply local rotation offsets after the follow, so the behavior still working the way the user will expect" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FP3D::LocalOrientation" + }, + "parameters": [ + "", + "Object", + "RotationXOffset", + "RotationYOffset", + "AngleOffset", + "" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + }, + { + "name": "z", + "type": "number", + "value": 0 + }, + { + "name": "a", + "type": "number", + "value": 0 + }, + { + "name": "rx", + "type": "number", + "value": 0 + }, + { + "name": "ry", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Local Y-axis offset relative to camera center", + "name": "VerticalOffset", + "type": "expression" + }, + { + "description": "Local X-axis offset relative to camera center", + "name": "HorizontalOffset", + "type": "expression" + }, + { + "description": "Distance between Camera and Object", + "name": "Distance", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Smoothing for position (0 = instant, >0 = smooth", + "name": "lerp", + "type": "expression" + }, + { + "description": "Toggle to make the object match camera rotation", + "name": "FollowAngles", + "type": "yesorno" + }, + { + "description": "Smoothing for rotation (0 = instant, >0 = smooth)", + "name": "angularLerp", + "type": "expression" + }, + { + "description": "Additional rotation offset (Yaw)", + "name": "AngleOffset", + "type": "expression" + }, + { + "description": "Additional elevation offset (Pitch)", + "name": "RotationYOffset", + "type": "expression" + }, + { + "description": "Additional tilt offset (Roll)", + "name": "RotationXOffset", + "type": "expression" + }, + { + "description": "Toggle Y-axis rotation inheritance (\"Yes\"/\"No\")", + "name": "ApplyRotY", + "supplementaryInformation": "[\"Yes\",\"No\"]", + "type": "yesorno" + }, + { + "description": "Toggle X-axis rotation inheritance (\"Yes\"/\"No\")", + "name": "ApplyRotX", + "supplementaryInformation": "[\"Yes\",\"No\"]", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Positions a follower object relative to a target object's 3D position and rotation. It translates local offsets into global world coordinates, allowing the follower to maintain its relative position even as the target moves and rotates in three dimensions.", + "fullName": "Put Object in front of Another", + "functionType": "Action", + "group": "Position", + "name": "PositioningObject", + "sentence": "Position object _PARAM1_ in front of _PARAM14_ with distance _PARAM4_, with Xoffset _PARAM3_, Yoffset _PARAM2_, with lerp (float) _PARAM6_ and follow Angles? _PARAM7_; angular lerp _PARAM8_. angles offsets: angle _PARAM9_, Yelevation: _PARAM10_, XElevation: _PARAM11_, Enables YRotation? _PARAM12_ Enables XRotation? _PARAM13_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "x", + "=", + "FP3D::AttatchPos(Target.CenterX(), Target.CenterY(), Target.Object3D2::CenterZ(), Target.Angle(), Target.Object3D2::RotationX(), Target.Object3D2::RotationY(), Distance, HorizontalOffset, VerticalOffset, \"X\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "y", + "=", + "FP3D::AttatchPos(Target.CenterX(), Target.CenterY(), Target.Object3D2::CenterZ(), Target.Angle(), Target.Object3D2::RotationX(), Target.Object3D2::RotationY(), Distance, HorizontalOffset, VerticalOffset, \"Y\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "z", + "=", + "FP3D::AttatchPos(Target.CenterX(), Target.CenterY(), Target.Object3D2::CenterZ(), Target.Angle(), Target.Object3D2::RotationX(), Target.Object3D2::RotationY(), Distance, HorizontalOffset, VerticalOffset, \"Z\")" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "angle", + "=", + "Target.Angle()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "roty", + "=", + "Target.Object3D2::RotationY()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "rotx", + "=", + "Target.Object3D2::RotationX()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "lerp", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object", + "=", + "x", + "=", + "y" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "z" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "lerp", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object", + "=", + "lerp(Object.CenterX(),x, lerp)", + "=", + "lerp(Object.CenterY(),y, lerp)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "lerp(Object.Object3D::CenterZ(), z, lerp)" + ] + } + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "FollowAngles", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "angularLerp", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "angle" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "applyRotY", + "=", + "\"Yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "roty" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "applyRotX", + "=", + "\"Yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "rotx" + ] + } + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "angularLerp", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "lerpAngle(Object.Angle(), angle, angularLerp)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "applyRotY", + "=", + "\"Yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "lerpAngle(Object.Object3D::RotationY(), roty, angularLerp)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "applyRotX", + "=", + "\"Yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "lerpAngle(Object.Object3D::RotationX(),rotx,angularLerp)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FP3D::LocalOrientation" + }, + "parameters": [ + "", + "Object", + "XRotOffset", + "ElevationOffset", + "AngleOffset", + "" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + }, + { + "name": "z", + "type": "number", + "value": 0 + }, + { + "name": "angle", + "type": "number", + "value": 0 + }, + { + "name": "rotx", + "type": "number", + "value": 0 + }, + { + "name": "roty", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Local Vertical (Y) offset", + "name": "VerticalOffset", + "type": "expression" + }, + { + "description": "Local Horizontal (X) offset", + "name": "HorizontalOffset", + "type": "expression" + }, + { + "description": "Distance between Objects", + "name": "Distance", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Movement smoothing (0 = instant, >0 = smooth)", + "name": "lerp", + "type": "expression" + }, + { + "description": "Toggle to inherit Target's rotation", + "name": "FollowAngles", + "type": "yesorno" + }, + { + "description": "Rotation smoothing factor", + "name": "angularLerp", + "type": "expression" + }, + { + "description": "Angle offset", + "name": "AngleOffset", + "type": "expression" + }, + { + "description": "Vertical Angle offset", + "name": "ElevationOffset", + "type": "expression" + }, + { + "description": "The Roll offset", + "name": "XRotOffset", + "type": "expression" + }, + { + "description": "Apply rotationY for the object", + "name": "applyRotY", + "supplementaryInformation": "[\"Yes\",\"No\"]", + "type": "stringWithSelector" + }, + { + "description": "Apply RotationX for the object", + "name": "applyRotX", + "supplementaryInformation": "[\"Yes\",\"No\"]", + "type": "stringWithSelector" + }, + { + "description": "The object to be followed", + "name": "Target", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D2", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Moves a physics-enabled object to a relative position in front of the camera by manipulating its Linear Velocity. This creates a \"magnetic\" follow effect where the object smoothly trails the camera but remains a physical entity that can interact with the environment.", + "fullName": "Put Object in front of Camera with Physics", + "functionType": "Action", + "group": "Position", + "name": "PositioningCameraPhysics", + "sentence": "Position object _PARAM1_ at the center of camera with distance _PARAM2_, with Xoffset _PARAM3_, Yoffset _PARAM4_, with force _PARAM7_ with Physics", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityX" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "(FP3D::AttatchPos(CameraCenterX(Object.Layer()), CameraCenterY(Object.Layer()), Scene3D::CameraZ(Object.Layer()), CameraAngle(Object.Layer())+90, Scene3D::CameraRotationY(Object.Layer()), Scene3D::CameraRotationX(Object.Layer())+90, Distance, -HorizontalOffset, -VerticalOffset, \"X\")-Object.CenterX()) * Force" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityY" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "(FP3D::AttatchPos(CameraCenterX(Object.Layer()), CameraCenterY(Object.Layer()), Scene3D::CameraZ(Object.Layer()), CameraAngle(Object.Layer())+90, Scene3D::CameraRotationY(Object.Layer()), Scene3D::CameraRotationX(Object.Layer())+90, Distance, -HorizontalOffset, -VerticalOffset, \"Y\")-Object.CenterY()) * Force" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityZ" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "(FP3D::AttatchPos(CameraCenterX(Object.Layer()), CameraCenterY(Object.Layer()), Scene3D::CameraZ(Object.Layer()), CameraAngle(Object.Layer())+90, Scene3D::CameraRotationY(Object.Layer()), Scene3D::CameraRotationX(Object.Layer())+90, Distance, -HorizontalOffset, -VerticalOffset, \"Z\")-Object.Object3D::CenterZ()) * Force" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Distance between Camera and Object", + "name": "Distance", + "type": "expression" + }, + { + "description": "2D pos in X Axis, 0 is center", + "name": "HorizontalOffset", + "type": "expression" + }, + { + "description": "2D pos in Y Axis, 0 is center", + "name": "VerticalOffset", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "Force in direction of the center", + "name": "Force", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Positions a follower object relative to a target object's 3D position and rotation Using Physics engine. It translates local offsets into global world coordinates, allowing the follower to maintain its relative position even as the target moves and rotates in three dimensions.", + "fullName": "Put Object in front of Another with Physics", + "functionType": "Action", + "group": "Position", + "name": "PositioningPhysics", + "sentence": "Put _PARAM1_ in front of _PARAM4_ with distance of _PARAM6_, Horizontal Distance of _PARAM7_, Vertical Distance of _PARAM8_ and with an strength of _PARAM9_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityX" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "(FP3D::AttatchPos(Target.CenterX(), Target.CenterY(), Target.Object3D2::CenterZ(), Target.Angle(), Target.Object3D2::RotationX(), Target.Object3D2::RotationY(), Distance, HorizontalOffset, VerticalOffset, \"X\")-Object.CenterX()) * Strength" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityY" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "(FP3D::AttatchPos(Target.CenterX(), Target.CenterY(), Target.Object3D2::CenterZ(), Target.Angle(), Target.Object3D2::RotationX(), Target.Object3D2::RotationY(), Distance, HorizontalOffset, VerticalOffset, \"Y\")-Object.CenterY()) * Strength" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityZ" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "(FP3D::AttatchPos(Target.CenterX(), Target.CenterY(), Target.Object3D2::CenterZ(), Target.Angle(), Target.Object3D2::RotationX(), Target.Object3D2::RotationY(), Distance, HorizontalOffset, VerticalOffset, \"Z\")-Object.Object3D::CenterZ()) * Strength" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "Object", + "name": "Target", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D2", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Distance between Camera and Object", + "name": "Distance", + "type": "expression" + }, + { + "description": "2D pos in X Axis, 0 is center", + "name": "HorizontalOffset", + "type": "expression" + }, + { + "description": "2D pos in Y Axis, 0 is center", + "name": "VerticalOffset", + "type": "expression" + }, + { + "description": "The force of the grab", + "name": "Strength", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Constrains the position of one object relative to another based on a minimum distance, a maximum distance, and an angular \"cone\" limit based on the target object's orientation.", + "fullName": "Apply 3D Distance and Angle Constraint", + "functionType": "Action", + "group": "Position", + "name": "DistanceConstraintObjects", + "sentence": "Apply Constraint on _PARAM1_ to _PARAM3_ with minimum distance of _PARAM5_ and maximum distance of _PARAM6_. (Limit angle: _PARAM7_°)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object1", + "=", + "FP3D::DistanceConstraint(Object2.CenterX(), Object2.CenterY(), Object2.Object3D1::CenterZ(), Object1.CenterX(), Object1.CenterY(),Object1.Object3D::CenterZ(), Object2.Angle(), Object2.Object3D1::RotationY(), MinDistance, MaxDistance, AngleLimit, \"X\")", + "=", + "FP3D::DistanceConstraint(Object2.CenterX(), Object2.CenterY(), Object2.Object3D1::CenterZ(), Object1.CenterX(), Object1.CenterY(),Object1.Object3D::CenterZ(), Object2.Angle(), Object2.Object3D1::RotationY(), MinDistance, MaxDistance, AngleLimit, \"Y\")" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "Object1", + "Object3D", + "=", + "FP3D::DistanceConstraint(Object2.CenterX(), Object2.CenterY(), Object2.Object3D1::CenterZ(), Object1.CenterX(), Object1.CenterY(),Object1.Object3D::CenterZ(), Object2.Angle(), Object2.Object3D1::RotationY(), MinDistance, MaxDistance, AngleLimit, \"Z\")" + ] + } + ] + } + ], + "parameters": [ + { + "description": "The \"anchor\" or reference object", + "name": "Object1", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "The object to be moved/constrained", + "name": "Object2", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D1", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "The closest the object is allowed to get", + "name": "MinDistance", + "type": "expression" + }, + { + "description": "The furthest Object is allowed to stray", + "name": "MaxDistance", + "type": "expression" + }, + { + "description": "The maximum angle (in degrees) Object2 can deviate from the forward facing direction of Object parent", + "name": "AngleLimit", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Uses the 3D Physics engine to apply impulses that keep an object within a specific spherical and angular range of another object. Because it uses forces, the movement is fluid and respects the object's mass and velocity.", + "fullName": "Apply 3D Physics-based Distance and Angle Constraint", + "functionType": "Action", + "group": "Position", + "name": "DistanceConstraintPhysics", + "sentence": "Apply a physical constraint of _PARAM9_ strength to _PARAM1_ relative to _PARAM4_ (Range: _PARAM6_ to _PARAM7_, Max Angle: _PARAM8_°)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityX" + }, + "parameters": [ + "Object1", + "Physics3D", + "=", + "(FP3D::DistanceConstraint(Object2.CenterX(), Object2.CenterY(), Object2.Object3D1::CenterZ(), Object1.CenterX(), Object1.CenterY(), Object1.Object3D::CenterZ(), Object2.Angle(), Object2.Object3D1::RotationY(), MinDistance, MaxDistance, AngleLimit, \"X\")-Object1.CenterX())*Strength" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityY" + }, + "parameters": [ + "Object1", + "Physics3D", + "=", + "(FP3D::DistanceConstraint(Object2.CenterX(), Object2.CenterY(), Object2.Object3D1::CenterZ(), Object1.CenterX(), Object1.CenterY(), Object1.Object3D::CenterZ(), Object2.Angle(), Object2.Object3D1::RotationY(), MinDistance, MaxDistance, AngleLimit, \"Y\")-Object1.CenterY())*Strength" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityZ" + }, + "parameters": [ + "Object1", + "Physics3D", + "=", + "(FP3D::DistanceConstraint(Object2.CenterX(), Object2.CenterY(), Object2.Object3D1::CenterZ(), Object1.CenterX(), Object1.CenterY(), Object1.Object3D::CenterZ(), Object2.Angle(), Object2.Object3D1::RotationY(), MinDistance, MaxDistance, AngleLimit, \"Z\")-Object1.Object3D::CenterZ())*Strength" + ] + } + ] + } + ], + "parameters": [ + { + "description": "The physics object to be constrained", + "name": "Object1", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "the Anchor", + "name": "Object2", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D1", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "The inner boundary radius", + "name": "MinDistance", + "type": "expression" + }, + { + "description": "The outer boundary radius", + "name": "MaxDistance", + "type": "expression" + }, + { + "description": "The maximum cone angle (0-360°) from Object1's forward face", + "name": "AngleLimit", + "type": "expression" + }, + { + "description": "How \"snappy\" the correction is. Higher values act like stiff springs; lower values act like rubber bands", + "name": "Strength", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Gets the elevation angle between positions.", + "fullName": "Elevation Between Positions", + "functionType": "Expression", + "group": "InnerFunctions", + "name": "ElevationBetweenPositions", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dist", + "=", + "sqrt(pow((X - X2), 2) + pow((Y - Y2), 2))" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ToDeg(atan2(Z2 - Z, DistanceBetweenPositions(X, Y, X2, Y2)))" + ] + } + ], + "variables": [ + { + "name": "dist", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "First position in X axis", + "name": "X", + "type": "expression" + }, + { + "description": "First position in Y axis", + "name": "Y", + "type": "expression" + }, + { + "description": "First position in Z axis", + "name": "Z", + "type": "expression" + }, + { + "description": "Second posiition in X axis", + "name": "X2", + "type": "expression" + }, + { + "description": "Second posiition in Y axis", + "name": "Y2", + "type": "expression" + }, + { + "description": "Second posiition in Z axis", + "name": "Z2", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if object is at the screen projection field of view.", + "fullName": "Is on screen projection", + "functionType": "Condition", + "group": "Objects", + "name": "IsOnScreen", + "sentence": "_PARAM1_ is on screen (Radius: _PARAM3_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "using Overlay(...\"ForwardDistance\") we can check if the object is in front of camera's view, then we just need to check if the object is fitting on screen in its 2D projection." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "FP3D::Overlay(Object.CenterX(), Object.CenterY(), Object.b3D::CenterZ(), \"ForwardDistance\", Scene3D::CameraNearPlane(),\"yes\")", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "FP3D::Overlay(Object.CenterX(), Object.CenterY(), Object.b3D::CenterZ(), \"X\", Scene3D::CameraNearPlane(),\"yes\")", + ">", + "0-Radius" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "FP3D::Overlay(Object.CenterX(), Object.CenterY(), Object.b3D::CenterZ(), \"X\", Scene3D::CameraNearPlane(), \"yes\")", + "<", + "SceneWindowWidth()+Radius" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "FP3D::Overlay(Object.CenterX(), Object.CenterY(), Object.b3D::CenterZ(), \"Y\", Scene3D::CameraNearPlane(), \"yes\")", + ">", + "0-Radius" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "FP3D::Overlay(Object.CenterX(), Object.CenterY(), Object.b3D::CenterZ(), \"Y\", Scene3D::CameraNearPlane(), \"yes\")", + "<", + "SceneWindowHeight()+Radius" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object to be detected", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "b3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Radius of detection", + "name": "Radius", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Pick the instance that is nearest to the camera Center (it doesn't take into account distance between the object or if is not visible).", + "fullName": "Pick the object nearest to the camera center", + "functionType": "Condition", + "group": "Objects", + "name": "PickCameraCenter", + "sentence": "Pick the instance of _PARAM1_ nearest to camera center from layer _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//picking is impossible or atleast very hard to do with events", + "", + "const objectsLists = eventsFunctionContext.getObjectsLists(\"Object\");", + "const lay = eventsFunctionContext.getArgument(\"Layer\");", + "const items = objectsLists.items;", + "", + "const width = runtimeScene.getGame().getGameResolutionWidth();", + "const height = runtimeScene.getGame().getGameResolutionHeight();", + "const centerX = width / 2;", + "const centerY = height / 2;", + "", + "let minDist = Infinity;", + "let nearestObjects = [];", + "", + "const renderer = runtimeScene.getLayer(lay).getRenderer();", + "const threeCamera = renderer.getThreeCamera();", + "", + "// loop to funilate the nearest one, took directly from Arthuro's pickingTools and adapted.", + "for (const listName in items) {", + " const list = items[listName];", + " for (const instance of list) {", + "", + " // 1. Iterates through each object and determines its position on the 2D screen.", + " const threeObj = instance.get3DRendererObject();", + " if (!threeObj) continue;", + "", + " const pos = new THREE.Vector3();", + " threeObj.getWorldPosition(pos);", + " ", + " // using an equivalent of the Overlay() but internally", + " pos.project(threeCamera); ", + "", + " // 2. If the object is visible in front of the camera, it calculates distance to screen center.", + " if (pos.z > 1) continue;", + "", + " const screenX = (pos.x + 1) * width / 2;", + " const screenY = -(pos.y - 1) * height / 2;", + "", + " const dx = screenX - centerX;", + " const dy = screenY - centerY;", + " const distance = Math.sqrt(dx * dx + dy * dy);", + "", + " // 3. If this object's distance is LESS than the currently recorded minDist:", + " // minDist is updated, nearestObjects is cleared, and this object becomes the favorite.", + " if (distance < minDist) {", + " minDist = distance;", + " nearestObjects = [instance]; ", + " } else if (distance === minDist) {", + " // 4. If exact distance tie, add to the array alongside others.", + " nearestObjects.push(instance); ", + " }", + " }", + " ", + " // 5. Clears the original GDevelop list to wipe out old references.", + " list.length = 0; ", + "}", + "", + "// 6. Inserts ONLY the winning object(s) back into the list that GDevelop reads.", + "if (nearestObjects.length !== 0) {", + " for (const object of nearestObjects) {", + " const name = object.getName();", + " if (items[name]) {", + " items[name].push(object);", + " }", + " }", + " eventsFunctionContext.returnValue = true;", + "} else {", + " eventsFunctionContext.returnValue = false;", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object to be detected", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Layer", + "name": "Layer", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Checks if an object is looking towards another withing an angle limit (or field of view). This accounts for both the 2D angle and the 3D Y-axis rotation (pitch).\n(Radius Based).", + "fullName": "Is looking Towards Another Object (Radius Based)", + "functionType": "Condition", + "group": "Angle", + "name": "IsLookingAtObject", + "sentence": "_PARAM1_ is looking at _PARAM3_ (within _PARAM5_°) (target radius _PARAM6_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FP3D::IsLookingAtPosition" + }, + "parameters": [ + "", + "Object1", + "Object3D", + "Object2.CenterX()", + "Object2.CenterY()", + "Object2.Object3D1::CenterZ()", + "FieldOfView", + "Radius", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object that is looking", + "name": "Object1", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Target", + "name": "Object2", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D1", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Field of view of the object", + "name": "FieldOfView", + "type": "expression" + }, + { + "description": "Detection radius of the target", + "name": "Radius", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Checks if an object is looking towards an position withing an angle limit (or field of view). This accounts for both the 2D angle and the 3D Y-axis rotation (pitch).", + "fullName": "Is looking Towards An Position", + "functionType": "Condition", + "group": "Angle", + "name": "IsLookingAtPosition", + "sentence": "_PARAM1_ is looking at _PARAM3_ , _PARAM4_, _PARAM5_(within _PARAM6_°) with radius of _PARAM7_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CuDist", + "=", + "FP3D::Distance(posX, posY, posZ, Object1.CenterX(), Object1.CenterY(), Object1.Object3D::CenterZ())" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dX", + "=", + "(posX - Object1.CenterX()) / CuDist" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dy", + "=", + "(posY - Object1.CenterY()) / CuDist" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dz", + "=", + "(posZ- Object1.Object3D::CenterZ()) / CuDist" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "fwdx", + "=", + "Object1.Object3D::ForwardX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "fwdy", + "=", + "Object1.Object3D::ForwardY()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "fwdz", + "=", + "Object1.Object3D::ForwardZ()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dt", + "=", + "(fwdx* dX) + (fwdy* dy) + (fwdz* dz)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "a", + "=", + "acos(clamp(dt, -1, 1))" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "a", + "<=", + "ToRad((FieldOfView)/2) + asin(clamp(Radius / max(0.0001, CuDist), -1, 1))" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "variables": [ + { + "name": "CuDist", + "type": "number", + "value": 0 + }, + { + "name": "dX", + "type": "number", + "value": 0 + }, + { + "name": "dy", + "type": "number", + "value": 0 + }, + { + "name": "a", + "type": "number", + "value": 0 + }, + { + "name": "dz", + "type": "number", + "value": 0 + }, + { + "name": "fwdx", + "type": "number", + "value": 0 + }, + { + "name": "fwdy", + "type": "number", + "value": 0 + }, + { + "name": "fwdz", + "type": "number", + "value": 0 + }, + { + "name": "dt", + "type": "number", + "value": 0 + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "* CuDist (Current Distance):\n - Stores the straight-line 3D distance between Point 1 and Point 2.\n\n\n* dx, dy, dz (Direction Vector):\n - The normalized direction vector (length of 1) pointing from Object 1 \n to Object 2.\n\n* fwdx, fwdy, fwdz (Forward Vector):\n - Represents the \"forward\" direction vector, where obj is facing\n\n\n* dt (Dot Product):\n - The dot product between the forward vector (fwd) and the object direction vector (d).\n - A mathematical value indicating how aligned the two vectors are. It ranges \n from -1 (pointing in opposite directions) to 1 (perfectly aligned).\n\n* a (Angle):\n - The actual angle (in radians) between the anchor's front and the object's position.\n - Calculated by applying the arc cosine (acos) to the dot product (dt)." + } + ], + "parameters": [ + { + "description": "Object that is observing", + "name": "Object1", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Position to be found", + "name": "posX", + "type": "expression" + }, + { + "description": "Position to be found", + "name": "posY", + "type": "expression" + }, + { + "description": "Position to be found", + "name": "posZ", + "type": "expression" + }, + { + "description": "Field of view of the object", + "name": "FieldOfView", + "type": "expression" + }, + { + "description": "Radius of the target", + "name": "Radius", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Converts a set of 3D coordinates (X, Y, Z) into 2D screen coordinates (X, Y) and calculates a relative scale based on distance.", + "fullName": "Translate 3D positions for 2D planes", + "functionType": "Expression", + "group": "InnerFunctions", + "name": "Overlay", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "cx", + "=", + "CameraCenterX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "cy", + "=", + "CameraCenterY()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "cz", + "=", + "Scene3D::CameraZ()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "rotY", + "=", + "Scene3D::CameraRotationX()+90" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "rotX", + "=", + "CameraAngle()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "angle", + "=", + "CameraAngle()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dx", + "=", + "X - cx" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dz", + "=", + "Z - cz" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dy", + "=", + "Y - cy" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FL", + "=", + "(SceneWindowHeight() / (2 * tan(ToRad(Scene3D::CameraFov() / 2))))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "tx", + "=", + "dx * cos(ToRad(-rotX)) - dy * sin(ToRad(-rotX))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ty", + "=", + "dx * sin(ToRad(-rotX)) + dy * cos(ToRad(-rotX))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "fy", + "=", + "dz * cos(ToRad(-rotY)) - ty * sin(ToRad(-rotY))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "fz", + "=", + "dz * sin(ToRad(-rotY)) + ty * cos(ToRad(-rotY))" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"ForwardDistance\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "fz" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "!=", + "\"ForwardDistance\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "fz", + ">", + "MinDistance" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "x", + "=", + "(tx * FL / fz) + (SceneWindowWidth() / 2)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "y", + "=", + "(fy * FL / fz) + (SceneWindowHeight() / 2)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "size", + "=", + "FL" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "fz", + "<=", + "MinDistance" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "offscreen", + "=", + "\"no\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "x", + "=", + "(SceneWindowWidth() / 2) + cos(ToRad(ToDeg(atan2(fy, tx)))) * (SceneWindowWidth() / 2 - 5)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "y", + "=", + "(SceneWindowHeight() / 2) + sin(ToRad(ToDeg(atan2(fy, tx)))) * (SceneWindowHeight() / 2 - 5)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "offscreen", + "=", + "\"yes\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "x", + "=", + "ScreenWidth()+999999" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "y", + "=", + "ScreenHeight()+999999" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"X\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "x" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"Y\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "y" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"Size\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "offscreen", + "=", + "\"no\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(fz / FL, 0.01, 5)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "offscreen", + "=", + "\"yes\"" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "fz", + "<=", + "20" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "0" + ] + } + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"-Size\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "offscreen", + "=", + "\"no\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(FL / fz, 0.01, 5)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "offscreen", + "=", + "\"yes\"" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "fz", + "<=", + "20" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "0" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"Angle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ToDeg(atan2(fy, tx))" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "x", + "type": "number", + "value": 0 + }, + { + "name": "y", + "type": "number", + "value": 0 + }, + { + "name": "size", + "type": "number", + "value": 0 + }, + { + "name": "cx", + "type": "number", + "value": 0 + }, + { + "name": "cy", + "type": "number", + "value": 0 + }, + { + "name": "cz", + "type": "number", + "value": 0 + }, + { + "name": "rotX", + "type": "number", + "value": 0 + }, + { + "name": "rotY", + "type": "number", + "value": 0 + }, + { + "name": "angle", + "type": "number", + "value": 0 + }, + { + "name": "tx", + "type": "number", + "value": 0 + }, + { + "name": "ty", + "type": "number", + "value": 0 + }, + { + "name": "fy", + "type": "number", + "value": 0 + }, + { + "name": "FL", + "type": "number", + "value": 0 + }, + { + "name": "fz", + "type": "number", + "value": 0 + }, + { + "name": "dx", + "type": "number", + "value": 0 + }, + { + "name": "dz", + "type": "number", + "value": 0 + }, + { + "name": "dy", + "type": "number", + "value": 0 + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 0, + "g": 0, + "r": 0, + "textB": 244, + "textG": 244, + "textR": 248 + }, + "comment": "Explaining Variables:\n\ndx, dy, dz\n[Relative Distance Vectors (Deltas)]\nStore the raw, straight-line distance between the target object and the camera.\nThey function as a vector pointing from the origin point (camera) to the destination.\n\nFL (Focal Length)\n[Focal Length]\nRepresents the simulated distance between the camera lens and the film plane\n(the player's screen). It is dynamically calculated based on the Field of View\n(FOV) to dictate how pronounced the perspective effect (zoom) will be.\n\ntx, tz, fy, fz\n[Transformed Camera Local Coordinates]\nStore the target object's position RE-CALCULATED after rotating the world\naround the camera. They translate where the object is relative directly \"to the eyes\" of the camera:\ntx: Relative horizontal position (left/right relative to the lens center).\nfy: Relative vertical position (up/down relative to the lens center).\nfz: The Real Depth. Represents the linear distance forward or\nbackward from the camera. This is the most crucial variable for perspective division.\n\nx, y\n[Final 2D Screen Coordinates]\nThe final result of the algorithm. They represent the exact position in pixels (X, Y)\non the player's two-dimensional (2D) monitor screen where the 3D object should be\ndrawn or where a user interface (UI) element should be positioned.\n\nsize\n[Base Scale Factor]\nStores the focal length reference value to help calculate the object's\nvisual proportion (how large or small it should appear on the screen\ndepending on its distance).\n\n" + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "World X position of the 3D target", + "name": "X", + "type": "expression" + }, + { + "description": "World Y position of the 3D target", + "name": "Y", + "type": "expression" + }, + { + "description": "World Z position of the 3D target", + "name": "Z", + "type": "expression" + }, + { + "description": "Choose \"X\", \"Y\", \"Size\" and \"-Size\"", + "name": "Return", + "supplementaryInformation": "[\"X\",\"Y\",\"Size\",\"-Size\",\"ForwardDistance\",\"Angle\"]", + "type": "stringWithSelector" + }, + { + "description": "Minimum Distance", + "longDescription": "The Distance to be considered In front of camera.", + "name": "MinDistance", + "type": "expression" + }, + { + "description": "returns an coordenate offscreen", + "name": "offscreen", + "supplementaryInformation": "[\"yes\",\"no\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Changes Objects Position Relative to an 3D coordenate and Camera.", + "fullName": "Overlay Object", + "functionType": "Action", + "group": "Position", + "name": "OverlayScale", + "sentence": "Project object _PARAM1_ to 3D position X: _PARAM3_, Y: _PARAM4_, Z: _PARAM5_ (Offsets: _PARAM6_, _PARAM7_). Change scale? _PARAM8_ (Invert? _PARAM9_, Offset: _PARAM10_). Hide if off-screen? _PARAM11_. Minimum distance for detection _PARAM12_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "========================" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Hide", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetXY" + }, + "parameters": [ + "Object", + "=", + "FP3D::Overlay(X, Y , Z, \"X\",MinDistance, \"yes\")+OffsetX ", + "=", + "FP3D::Overlay(X, Y , Z, \"Y\",MinDistance, \"yes\")+OffsetY " + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ChangeScale", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "InvertScale", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "=", + "FP3D::Overlay(X, Y , Z, \"Size\",MinDistance, \"no\") + SizeOffset" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "InvertScale", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "=", + "FP3D::Overlay(X, Y , Z, \"-Size\",MinDistance, \"no\") - SizeOffset" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + "<", + "0" + ] + }, + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + "<", + "0" + ] + }, + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + ">", + "SceneWindowHeight()" + ] + }, + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + ">", + "SceneWindowWidth()" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "Object" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "Show" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "========================" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Hide", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Show" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetXY" + }, + "parameters": [ + "Object", + "=", + "FP3D::Overlay(X, Y , Z, \"X\",MinDistance, \"no\")+OffsetX ", + "=", + "FP3D::Overlay(X, Y , Z, \"Y\",MinDistance, \"no\")+OffsetY " + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ChangeScale", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "InvertScale", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "=", + "FP3D::Overlay(X, Y , Z, \"Size\",MinDistance, \"no\") + SizeOffset" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "InvertScale", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "=", + "FP3D::Overlay(X, Y , Z, \"-Size\",MinDistance, \"no\") - SizeOffset" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "2D Object to overlay", + "name": "Object", + "type": "objectList" + }, + { + "description": "Scalable objects", + "name": "Scale", + "supplementaryInformation": "ScalableCapability::ScalableBehavior", + "type": "behavior" + }, + { + "description": "3D position to be overlayed in X axis", + "name": "X", + "type": "expression" + }, + { + "description": "3D position to be overlayed Y axis", + "name": "Y", + "type": "expression" + }, + { + "description": "3D position to be overlayed in Z axis", + "name": "Z", + "type": "expression" + }, + { + "description": "2D position offset X axis", + "name": "OffsetX", + "type": "expression" + }, + { + "description": "2D position offset Y axis", + "name": "OffsetY", + "type": "expression" + }, + { + "description": "Change scale based on distance", + "name": "ChangeScale", + "type": "yesorno" + }, + { + "description": "Invert scale behavior", + "name": "InvertScale", + "type": "yesorno" + }, + { + "description": "Value to change the size offset (+64/-32)", + "name": "SizeOffset", + "type": "expression" + }, + { + "description": "Hide when off screen", + "name": "Hide", + "type": "yesorno" + }, + { + "description": "Minimum distance to be considered in front of the camera", + "name": "MinDistance", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Changes Objects Position Relative to an 3D coordenate and Camera\n(for no scalable objects, such as texts).", + "fullName": "Overlay Object (non-scalable objects compatible)", + "functionType": "Action", + "group": "Position", + "name": "OverlayNonScale", + "sentence": "Project object _PARAM1_ to 3D position X: _PARAM2_, Y: _PARAM3_, Z: _PARAM4_ (Offsets: _PARAM5_, _PARAM6_). Hide if off-screen? _PARAM7_. Minimum Distance _PARAM8_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Hide", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetXY" + }, + "parameters": [ + "Object", + "=", + "FP3D::Overlay(X, Y , Z, \"X\",MinDistance, \"yes\")+OffsetX", + "=", + "FP3D::Overlay(X, Y , Z, \"Y\",MinDistance, \"yes\")+OffsetY " + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + "<", + "0" + ] + }, + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + "<", + "0" + ] + }, + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + ">", + "SceneWindowHeight()" + ] + }, + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + ">", + "SceneWindowWidth()" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "Object" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "Show" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Hide", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Show" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetXY" + }, + "parameters": [ + "Object", + "=", + "FP3D::Overlay(X, Y , Z, \"X\",MinDistance, \"no\")+OffsetX ", + "=", + "FP3D::Overlay(X, Y , Z, \"Y\",MinDistance, \"no\")+OffsetY " + ] + } + ] + } + ], + "parameters": [ + { + "description": "2D object to overlay", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D position to be overlayed", + "name": "X", + "type": "expression" + }, + { + "description": "3D position to be overlayed", + "name": "Y", + "type": "expression" + }, + { + "description": "3D position to be overlayed", + "name": "Z", + "type": "expression" + }, + { + "description": "2D Offset in that position", + "name": "OffsetX", + "type": "expression" + }, + { + "description": "2D Offset in that position", + "name": "OffsetY", + "type": "expression" + }, + { + "description": "Hide when out of sight", + "name": "Hide", + "type": "yesorno" + }, + { + "description": "Minimum distance to be considered in front", + "name": "MinDistance", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Calculates X and Y normals and gives you the angle based on that.", + "fullName": "Translates Normal float's into angle", + "functionType": "Expression", + "group": "Angle", + "name": "NormalToAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "(ToDeg(atan2(Y, X)))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Normal X", + "name": "X", + "type": "expression" + }, + { + "description": "Normal Y", + "name": "Y", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Calculates all normals and gives you the elevation angle based on that.", + "fullName": "Gets the Elevation angle from normals", + "functionType": "Expression", + "group": "Angle", + "name": "NormalToElevation", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "-(ToDeg(atan2(Z, sqrt(pow(X, 2) + pow(Y, 2)))))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Normal X", + "name": "X", + "type": "expression" + }, + { + "description": "Normal Y", + "name": "Y", + "type": "expression" + }, + { + "description": "Normal Z", + "name": "Z", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Applies a continuous 3D force to the object's center towards a specific position.", + "fullName": "Apply Linear Force Towards an Position", + "functionType": "Action", + "group": "Position", + "name": "ForceLinearPhysicsTowardsPosition", + "sentence": "Apply a force of _PARAM3_ to _PARAM1_ towards _PARAM5_, _PARAM6_, _PARAM7_. Additive force? _PARAM8_", + "events": [ + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Object", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Distance", + "=", + "FP3D::Distance(Object.CenterX(), Object.CenterY(), Object.Object3D::CenterZ(), PositionX, PositionY, PositionZ)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Additive", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityX" + }, + "parameters": [ + "Object", + "Physics3D", + "+", + "Force * (PositionX - Object.CenterX()) / Distance" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityY" + }, + "parameters": [ + "Object", + "Physics3D", + "+", + "Force * (PositionY - Object.CenterY()) / Distance" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityZ" + }, + "parameters": [ + "Object", + "Physics3D", + "+", + "(Force * (PositionZ - Object.Object3D::CenterZ()) / Distance)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Additive", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityX" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "Force * (PositionX - Object.CenterX()) / Distance" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityY" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "Force * (PositionY - Object.CenterY()) / Distance" + ] + }, + { + "type": { + "value": "Physics3D::Physics3DBehavior::SetLinearVelocityZ" + }, + "parameters": [ + "Object", + "Physics3D", + "=", + "(Force * (PositionZ - Object.Object3D::CenterZ()) / Distance)" + ] + } + ] + } + ], + "variables": [ + { + "name": "angle", + "type": "number", + "value": 0 + }, + { + "name": "Distance", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "The object that will receive the force", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D physics engine", + "name": "Physics3D", + "supplementaryInformation": "Physics3D::Physics3DBehavior", + "type": "behavior" + }, + { + "description": "The magnitude of the force (acceleration depends on object mass)", + "name": "Force", + "type": "expression" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Target Position in X axis", + "name": "PositionX", + "type": "expression" + }, + { + "description": "Target Position in Y axis", + "name": "PositionY", + "type": "expression" + }, + { + "description": "Target Position in Z axis", + "name": "PositionZ", + "type": "expression" + }, + { + "description": "Constantly Adds the value to the force", + "name": "Additive", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Oscilate the object position using the base value as the center.", + "fullName": "Oscilate Object", + "functionType": "Action", + "group": "Position", + "name": "OscilateObject", + "sentence": "Oscilate _PARAM1_ on _PARAM3_ axis with the distance of _PARAM5_ and time between each oscilation of _PARAM4_, and the center of the sine of _PARAM6_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Axis", + "=", + "\"Z\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "FP3D::Oscilate(baseValue, Distance, Time)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Axis", + "=", + "\"X\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetX" + }, + "parameters": [ + "Object", + "=", + "FP3D::Oscilate(baseValue, Distance, Time)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Axis", + "=", + "\"Y\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetY" + }, + "parameters": [ + "Object", + "=", + "FP3D::Oscilate(baseValue, Distance, Time)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Axis", + "=", + "\"Angle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "FP3D::Oscilate(baseValue, Distance, Time)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Axis", + "=", + "\"Elevation\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "FP3D::Oscilate(baseValue, Distance, Time)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Axis", + "=", + "\"Roll\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationX" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "FP3D::Oscilate(baseValue, Distance, Time)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "3D capability", + "name": "Object3D", + "supplementaryInformation": "Scene3D::Base3DBehavior", + "type": "behavior" + }, + { + "description": "Axis and Angle", + "name": "Axis", + "supplementaryInformation": "[\"X\",\"Y\",\"Z\",\"Angle\",\"Elevation\",\"Roll\"]", + "type": "stringWithSelector" + }, + { + "description": "Time of each oscilation", + "name": "Time", + "type": "expression" + }, + { + "description": "Distance from the base value of each oscilation", + "name": "Distance", + "type": "expression" + }, + { + "description": "Base position to oscilate in", + "name": "baseValue", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Oscilate an value to an maximum distance using an base value as the center.", + "fullName": "Oscilate Value", + "functionType": "Expression", + "group": "InnerFunctions", + "name": "Oscilate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "baseValue + (Distance * sin(TimeFromStart() / Time))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Base position to oscilate in", + "name": "baseValue", + "type": "expression" + }, + { + "description": "Maximum distance from the base value", + "name": "Distance", + "type": "expression" + }, + { + "description": "Time", + "name": "Time", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Compare Two Angles and normalize second one, by returning an value that is the exact first angle or negative of that.", + "fullName": "Snap Angle to Another", + "functionType": "Expression", + "group": "Angle", + "name": "SnapAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(AngleDifference(Angle1, Angle2))", + ">=", + "90" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Angle1+180" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(AngleDifference(Angle1, Angle2))", + "<", + "90" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Angle1" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Base Angle", + "name": "Angle1", + "type": "expression" + }, + { + "description": "Current angle to be snapped", + "name": "Angle2", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Applies local offsets of the object.", + "fullName": "Local Orientation Offset", + "functionType": "Action", + "group": "Angle", + "name": "LocalOrientation", + "sentence": "Change Orientation offsets of _PARAM1_, _PARAM2_ ; _PARAM3_ ; _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const objects = eventsFunctionContext.getObjects(\"Object\");", + "if (objects.length === 0) return;", + "const obj = objects[0];", + "", + "const offX = THREE.MathUtils.degToRad(eventsFunctionContext.getArgument(\"OffsetX\") || 0);", + "const offY = THREE.MathUtils.degToRad(eventsFunctionContext.getArgument(\"OffsetY\") || 0);", + "const offZ = THREE.MathUtils.degToRad(eventsFunctionContext.getArgument(\"OffsetZ\") || 0);", + "", + "const objThree = obj.get3DRendererObject(); ", + "", + "objThree.rotateY(offY); ", + "objThree.rotateX(offX);", + "objThree.rotateZ(offZ);", + "", + "// if there is an NATIVE way of doing the same thing it should be told in the review. most of rotations arent local as this function" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Object to be oriented", + "name": "Object", + "type": "objectList" + }, + { + "description": "Rotate object on X axis ", + "name": "OffsetX", + "supplementaryInformation": "[\"X\",\"Y\",\"Z\"]", + "type": "expression" + }, + { + "description": "Rotate object on Y axis", + "name": "OffsetY", + "supplementaryInformation": "[\"X\",\"Y\",\"Z\"]", + "type": "expression" + }, + { + "description": "Rotate object on Z axis", + "name": "OffsetZ", + "supplementaryInformation": "[\"X\",\"Y\",\"Z\"]", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Side of an target based on the provided values.", + "fullName": "Side of an Object", + "functionType": "StringExpression", + "group": "InnerFunctions", + "name": "SideString", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "side", + "=", + "FP3D::SideNumber(X1,Y1,TargetAngle,X2,Y2, Precision)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Precision", + "=", + "4" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "direction[side]" + ] + } + ], + "variables": [ + { + "folded": true, + "name": "direction", + "type": "array", + "children": [ + { + "type": "string", + "value": "Front" + }, + { + "type": "string", + "value": "Right" + }, + { + "type": "string", + "value": "Back" + }, + { + "type": "string", + "value": "Left" + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Precision", + "=", + "8" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "direction[side]" + ] + } + ], + "variables": [ + { + "name": "direction", + "type": "array", + "children": [ + { + "type": "string", + "value": "Front" + }, + { + "type": "string", + "value": "FrontRight" + }, + { + "type": "string", + "value": "Right" + }, + { + "type": "string", + "value": "BackRight" + }, + { + "type": "string", + "value": "Back" + }, + { + "type": "string", + "value": "BackLeft" + }, + { + "type": "string", + "value": "Left" + }, + { + "type": "string", + "value": "FrontLeft" + } + ] + } + ] + } + ], + "variables": [ + { + "name": "side", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Target X", + "name": "X1", + "type": "expression" + }, + { + "description": "Target Y", + "name": "Y1", + "type": "expression" + }, + { + "description": "Target Angle", + "name": "TargetAngle", + "type": "expression" + }, + { + "description": "Eyes X", + "name": "X2", + "type": "expression" + }, + { + "description": "Eyes Y", + "name": "Y2", + "type": "expression" + }, + { + "description": "Choose 4 or 8", + "name": "Precision", + "supplementaryInformation": "[\"4\",\"8\"]", + "type": "numberWithChoices" + } + ], + "objectGroups": [] + }, + { + "description": "Side of an target based on the provided values.", + "fullName": "Side of an Object", + "functionType": "Expression", + "group": "InnerFunctions", + "name": "SideNumber", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "angleToPos", + "=", + "atan2(EyesY - TargetY, EyesX - TargetX) * 180 / Pi()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "visangle", + "=", + "mod(angleToPos - TargetAngle + 90 + 180 + 450, 360)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "visangle", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "visangle", + "+", + "360" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "side", + "=", + "mod(round(visangle/ (360/ Precision)), Precision)" + ] + }, + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "side" + ] + } + ] + } + ], + "variables": [ + { + "name": "angleToPos", + "type": "number", + "value": 0 + }, + { + "name": "visangle", + "type": "number", + "value": 0 + }, + { + "name": "side", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Target X position", + "name": "TargetX", + "type": "expression" + }, + { + "description": "Target Y position", + "name": "TargetY", + "type": "expression" + }, + { + "description": "Target Angle", + "name": "TargetAngle", + "type": "expression" + }, + { + "description": "Eyes X position (ex. camera)", + "name": "EyesX", + "type": "expression" + }, + { + "description": "Eyes Y position (ex. camera)", + "name": "EyesY", + "type": "expression" + }, + { + "description": "Precision of the sides (eg. 8 will include diagonals)", + "name": "Precision", + "supplementaryInformation": "[\"4\",\"8\"]", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Constrains the position of one object relative to another based on a minimum distance, a maximum distance, and an angular \"cone\" limit based on the first object's orientation.", + "fullName": "Apply 3D Distance and Angle Constraint", + "functionType": "Expression", + "group": "InnerFunctions", + "name": "DistanceConstraint", + "sentence": "Apply a constraint of to _PARAM3_ relative to _PARAM1_ (Range: _PARAM5_ to _PARAM6_, Max Angle: _PARAM7_°)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CuDist", + "=", + "sqrt(pow(TargetX - AnchoredX, 2) + pow(TargetY - AnchoredY, 2) + pow(TargetZ - AnchoredZ, 2))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dx", + "=", + "(AnchoredX - TargetX) / CuDist" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dy", + "=", + "(AnchoredY - TargetY) / CuDist" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dz", + "=", + "(AnchoredZ - TargetZ) / CuDist" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "fwdx", + "=", + "cos(ToRad(TargetAngle)) * cos(ToRad(TargetRotation))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "fwdy", + "=", + "sin(ToRad(TargetAngle)) * cos(ToRad(TargetRotation))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "fwdz", + "=", + "-sin(ToRad(TargetRotation))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dt", + "=", + "(fwdx * dx) + (fwdy * dy) + (fwdz * dz)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "a", + "=", + "acos(clamp(dt, -1, 1))" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "a", + ">", + "ToRad(AngleLimit)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dx", + "=", + "fwdx * cos(ToRad(AngleLimit)) + (dx - fwdx * dt) / max(0.0001, sin(a)) * sin(ToRad(AngleLimit))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dy", + "=", + "fwdy * cos(ToRad(AngleLimit)) + (dy - fwdy * dt) / max(0.0001, sin(a)) * sin(ToRad(AngleLimit))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dz", + "=", + "fwdz * cos(ToRad(AngleLimit)) + (dz - fwdz * dt) / max(0.0001, sin(a)) * sin(ToRad(AngleLimit))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CuDist", + "=", + "clamp(CuDist, MinDistance, MaxDistance)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"X\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TargetX + dx * CuDist" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"Y\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TargetY + dy * CuDist" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Return", + "=", + "\"Z\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TargetZ + dz * CuDist" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "name": "CuDist", + "type": "number", + "value": 0 + }, + { + "name": "dx", + "type": "number", + "value": 0 + }, + { + "name": "dy", + "type": "number", + "value": 0 + }, + { + "name": "a", + "type": "number", + "value": 0 + }, + { + "name": "dz", + "type": "number", + "value": 0 + }, + { + "name": "fwdx", + "type": "number", + "value": 0 + }, + { + "name": "fwdy", + "type": "number", + "value": 0 + }, + { + "name": "fwdz", + "type": "number", + "value": 0 + }, + { + "name": "dt", + "type": "number", + "value": 0 + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "* CuDist (Current Distance):\n - Stores the straight-line 3D distance between Point 1 and Point 2.\n - At the end of the script, it is clamped so it never drops below MinDistance \n or exceeds MaxDistance.\n\n* dx, dy, dz (Direction Vector):\n - The normalized direction vector (length of 1) pointing from Object 1 \n to Object 2.\n - If the object exits the vision \"cone\", these variables are recalculated \n to push the object back to the edge of the allowed angular limit.\n\n* fwdx, fwdy, fwdz (Forward Vector):\n - Represents the \"forward\" direction vector of our anchor.\n - Converts the rotation angles (TargetAngle and TargetRotation) into 3D \n Cartesian coordinates to know exactly where Object 1 is facing.\n\n\n* dt (Dot Product):\n - The dot product between the forward vector (fwd) and the object direction vector (d).\n - A mathematical value indicating how aligned the two vectors are. It ranges \n from -1 (pointing in opposite directions) to 1 (perfectly aligned).\n\n* a (Angle):\n - The actual angle (in radians) between the anchor's front and the object's position.\n - Calculated by applying the arc cosine (acos) to the dot product (dt).\n\n\n\n1. Locate where the object is relative to the anchor (CuDist, dx, dy, dz).\n2. Determine where the anchor is facing (fwdx, fwdy, fwdz).\n3. Calculate the current angular deviation ('a').\n4. If the angle 'a' is greater than the allowed limit (AngleLimit):\n - The code executes vector math to reposition 'dX, dy, dz' exactly \n onto the outer boundary wall of the cone.\n5. Restrict the final distance (CuDist) between the minimum and maximum limits.\n6. Return the corrected position by multiplying the final direction by the distance:\n - New Position = Anchor Position + (Direction Vector * Constrained Distance)\n" + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The anchor position in X axis", + "name": "TargetX", + "type": "expression" + }, + { + "description": "The anchor position in Y axis", + "name": "TargetY", + "type": "expression" + }, + { + "description": "The anchor position in Z axis", + "name": "TargetZ", + "type": "expression" + }, + { + "description": "Current Position of the constrained in X axis", + "name": "AnchoredX", + "type": "expression" + }, + { + "description": "Current Position of the constrained in Y axis", + "name": "AnchoredY", + "type": "expression" + }, + { + "description": "Current Position of the constrained in Z axis", + "name": "AnchoredZ", + "type": "expression" + }, + { + "description": "Target horizontal angle", + "name": "TargetAngle", + "type": "expression" + }, + { + "description": "Target vertical angle", + "name": "TargetRotation", + "type": "expression" + }, + { + "description": "The closest the object is allowed to get", + "name": "MinDistance", + "type": "expression" + }, + { + "description": "The furthest Object is allowed to stray", + "name": "MaxDistance", + "type": "expression" + }, + { + "description": "The maximum angle (in degrees) Object2 can deviate from the forward facing direction of Object parent", + "name": "AngleLimit", + "type": "expression" + }, + { + "description": "Desired value", + "name": "Return", + "supplementaryInformation": "[\"X\",\"Y\",\"Z\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Gets distance between 2 positions.", + "fullName": "Distance between two positions", + "functionType": "Expression", + "group": "InnerFunctions", + "name": "Distance", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "sqrt(pow(X1 - X2, 2) + pow(Y1 - Y2, 2) + pow(Z1 - Z2, 2))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "First position in X axis", + "name": "X1", + "type": "expression" + }, + { + "description": "First position in Y axis", + "name": "Y1", + "type": "expression" + }, + { + "description": "First position in Z axis", + "name": "Z1", + "type": "expression" + }, + { + "description": "Second position in X axis", + "name": "X2", + "type": "expression" + }, + { + "description": "Second position in Y axis", + "name": "Y2", + "type": "expression" + }, + { + "description": "Second position in Z axis", + "name": "Z2", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "put object to be aligned to the line of sight of another.", + "fullName": "Snap Object at the center Line of another", + "functionType": "Action", + "group": "Angle", + "name": "SnapCenter", + "sentence": "Snap _PARAM1_ at the center line of _PARAM2_. (lerp scale: _PARAM3_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ux", + "=", + "cos(ToRad(Target.Angle()))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "uy", + "=", + "sin(ToRad(Target.Angle()))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "tx", + "=", + "Target.CenterX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ty", + "=", + "Target.CenterY()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dy", + "=", + "Object.CenterY() - ty" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dx", + "=", + "Object.CenterX() - tx" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "dp", + "=", + "(dx * ux) + (dy * uy)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "nx", + "=", + "tx + (dp * ux)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ny", + "=", + "ty + (dp * uy)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Object", + "=", + "lerp(Object.CenterX(), nx, LerpScale)", + "=", + "lerp(Object.CenterY(), ny, LerpScale)" + ] + } + ] + } + ], + "variables": [ + { + "name": "ux", + "type": "number", + "value": 0 + }, + { + "name": "uy", + "type": "number", + "value": 0 + }, + { + "name": "tx", + "type": "number", + "value": 0 + }, + { + "name": "ty", + "type": "number", + "value": 0 + }, + { + "name": "dx", + "type": "number", + "value": 0 + }, + { + "name": "dy", + "type": "number", + "value": 0 + }, + { + "name": "dp", + "type": "number", + "value": 0 + }, + { + "name": "nx", + "type": "number", + "value": 0 + }, + { + "name": "ny", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object to be snapped", + "name": "Object", + "type": "objectList" + }, + { + "description": "Reference target", + "name": "Target", + "type": "objectList" + }, + { + "description": "lerp scale", + "name": "LerpScale", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "folderName": "InnerFunctions", + "children": [ + { + "functionName": "AttatchPos" + }, + { + "functionName": "Overlay" + }, + { + "functionName": "DistanceConstraint" + }, + { + "functionName": "SideString" + }, + { + "functionName": "Oscilate" + }, + { + "functionName": "ElevationBetweenPositions" + }, + { + "functionName": "SideNumber" + }, + { + "functionName": "Distance" + } + ] + }, + { + "folderName": "Forces", + "children": [ + { + "functionName": "Impulse" + }, + { + "functionName": "ImpulseAtPoint" + }, + { + "functionName": "ImpulseTowardsPosition" + }, + { + "functionName": "ForceLinearPhysics" + }, + { + "functionName": "Force" + }, + { + "functionName": "ForceAtPoint" + }, + { + "functionName": "ForceTowardsPosition" + }, + { + "functionName": "ForceLinear" + }, + { + "functionName": "ForceLinearTowardsPosition" + } + ] + }, + { + "folderName": "Position", + "children": [ + { + "functionName": "CamColisionDist" + }, + { + "functionName": "CameraAway" + }, + { + "functionName": "ForceLinearPhysicsTowardsPosition" + }, + { + "functionName": "OscilateObject" + }, + { + "functionName": "PositioningCamera" + }, + { + "functionName": "PositioningCameraPhysics" + }, + { + "functionName": "PositioningObject" + }, + { + "functionName": "PositioningPhysics" + }, + { + "functionName": "DistanceConstraintObjects" + }, + { + "functionName": "DistanceConstraintPhysics" + }, + { + "functionName": "OverlayNonScale" + }, + { + "functionName": "OverlayScale" + } + ] + }, + { + "folderName": "Objects", + "children": [ + { + "functionName": "IsOnScreen" + }, + { + "functionName": "PickCameraCenter" + } + ] + }, + { + "folderName": "Angle", + "children": [ + { + "functionName": "IsLookingAtPosition" + }, + { + "functionName": "IsLookingAtObject" + }, + { + "functionName": "LocalOrientation" + }, + { + "functionName": "SnapCenter" + }, + { + "functionName": "SnapAngle" + }, + { + "functionName": "NormalToElevation" + }, + { + "functionName": "NormalToAngle" + } + ] + } + ] + }, + "eventsBasedBehaviors": [ + { + "description": "Automatically handles the complex math required to attach 3D objects (viewmodels, weapons, items) to the player's 3D camera. It supports linear and angular interpolation (lerping) for realistic weapon \"weight\" and sway.", + "fullName": "FPS Parenting", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXBpc3RvbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03LDVIMjNWOUgyMlYxMEgxNkExLDEgMCAwLDAgMTUsMTFWMTJBMiwyIDAgMCwxIDEzLDE0SDkuNjJDOS4yNCwxNCA4Ljg5LDE0LjIyIDguNzIsMTQuNTZMNi4yNywxOS40NUM2LjEsMTkuNzkgNS43NiwyMCA1LjM4LDIwSDJDMiwyMCAtMSwyMCAzLDE0QzMsMTQgNiwxMCAyLDEwVjVIM0wzLjUsNEg2LjVMNyw1TTE0LDEyVjExQTEsMSAwIDAsMCAxMywxMEgxMkMxMiwxMCAxMSwxMSAxMiwxMkEyLDIgMCAwLDEgMTAsMTBBMSwxIDAgMCwwIDksMTFWMTJBMSwxIDAgMCwwIDEwLDEzSDEzQTEsMSAwIDAsMCAxNCwxMloiIC8+PC9zdmc+", + "name": "FPSParenting", + "objectType": "", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/7369f754754433fe517eeb3e645f734d10d1150bf30a27aeffb1e639172aa4ee_pistol.svg", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Layer", + "=", + "Object.Layer()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Rotate", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "FP3D::PositioningCamera" + }, + "parameters": [ + "", + "Object", + "VerticalOffset", + "HorizontalOffset", + "Distance", + "Object3D", + "Lerping", + "no", + "AngularLerping", + "AngleOffset", + "ElevationOffset", + "XElevation", + "\"No\"", + "\"No\"", + "", + "Layer" + ] + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Rotate", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableYRot", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "FP3D::PositioningCamera" + }, + "parameters": [ + "", + "Object", + "VerticalOffset", + "HorizontalOffset", + "Distance", + "Object3D", + "Lerping", + "yes", + "AngularLerping", + "AngleOffset", + "ElevationOffset", + "XElevation", + "yes", + "EnableXRot", + "", + "Layer" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableXRot", + "False", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "FP3D::PositioningCamera" + }, + "parameters": [ + "", + "Object", + "VerticalOffset", + "HorizontalOffset", + "Distance", + "Object3D", + "Lerping", + "yes", + "AngularLerping", + "AngleOffset", + "ElevationOffset", + "XElevation", + "EnableYRot", + "yes", + "", + "Layer" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableYRot", + "True", + "" + ] + }, + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableXRot", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "FP3D::PositioningCamera" + }, + "parameters": [ + "", + "Object", + "VerticalOffset", + "HorizontalOffset", + "Distance", + "Object3D", + "Lerping", + "yes", + "AngularLerping", + "AngleOffset", + "ElevationOffset", + "XElevation", + "yes", + "yes", + "", + "Layer" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the current vertical offset.", + "fullName": "Vertical Offset Position", + "functionType": "ExpressionAndCondition", + "name": "VerticalOffset", + "sentence": "vertical Offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "VerticalOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "horizontal position (X-axis) relative to the camera.", + "fullName": "Horizontal Offset Position", + "functionType": "ExpressionAndCondition", + "name": "HorizontalOffset", + "sentence": "Horizontal Offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HorizontalOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "correction for the base horizontal angle.", + "fullName": "Angle Offset Position", + "functionType": "ExpressionAndCondition", + "name": "AngleOffset", + "sentence": "Angle Offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "AngleOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "correction for the base vertical angle.", + "fullName": "Elevation Offset Position", + "functionType": "ExpressionAndCondition", + "name": "ElevationOffset", + "sentence": "Elevation Offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ElevationOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "additional elevation adjustment on the X-axis.", + "fullName": "XElevation Offset Position", + "functionType": "ExpressionAndCondition", + "name": "XElevationOffset", + "sentence": "Elevation on X Axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "XElevation" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "forward distance of the object.", + "fullName": "Distance", + "functionType": "ExpressionAndCondition", + "name": "Distance", + "sentence": "Forward distance", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Distance" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"Yes\",\"No\"]", + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "linear interpolation of the object.", + "fullName": "Lerping", + "functionType": "ExpressionAndCondition", + "name": "Interpolation", + "sentence": "Position interpolation", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Lerping" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"Yes\",\"No\"]", + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalOffset", + "name": "HorizontalOffs", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalOffset", + "name": "VerticalOff", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "AngleOffset", + "name": "AngleOff", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AngleOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ElevationOffset", + "name": "ElevatioinOff", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ElevationOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "XElevationOffset", + "name": "XElevatioinOff", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "XElevation", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Distance", + "name": "Distance2", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Distance", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Interpolation", + "name": "Interpolation2", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Lerping", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FPSParenting", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "doStepPreEvents" + }, + { + "functionName": "VerticalOffset" + }, + { + "functionName": "ElevationOffset" + }, + { + "functionName": "HorizontalOffset" + }, + { + "functionName": "AngleOffset" + }, + { + "functionName": "XElevationOffset" + }, + { + "functionName": "Distance" + }, + { + "functionName": "Interpolation" + }, + { + "functionName": "HorizontalOffs" + }, + { + "functionName": "VerticalOff" + }, + { + "functionName": "AngleOff" + }, + { + "functionName": "ElevatioinOff" + }, + { + "functionName": "XElevatioinOff" + }, + { + "functionName": "Distance2" + }, + { + "functionName": "Interpolation2" + } + ] + }, + "propertyDescriptors": [ + { + "value": "-35", + "type": "Number", + "unit": "Pixel", + "label": "Vertical Position", + "description": "Sets the vertical (Y-axis) displacement relative to the camera center. Negative values move the object down.", + "name": "VerticalOffset" + }, + { + "value": "30", + "type": "Number", + "label": "Horizontal Position", + "description": "Sets the horizontal (X-axis) displacement relative to the camera center. Positive values move the object to the right.", + "name": "HorizontalOffset" + }, + { + "value": "true", + "type": "Boolean", + "label": "Follow Camera Rotation", + "description": "When enabled, the object will inherit the camera's Yaw, Pitch, and Roll. If disabled, it stays at a fixed angle.", + "name": "Rotate" + }, + { + "value": "0", + "type": "Number", + "label": "Yaw Offset", + "description": "Adds a base horizontal rotation (in degrees) to the object. Useful for correcting the model's forward facing.", + "name": "AngleOffset" + }, + { + "value": "0", + "type": "Number", + "label": "Pitch Offset", + "description": "Adds a base vertical rotation (in degrees). Use this to tilt the weapon or item up or down.", + "name": "ElevationOffset" + }, + { + "value": "0.7", + "type": "Number", + "label": "Movement Lerping", + "description": "Controls the linear interpolation of the position. A value of 1 is instant; 0.7 adds a smooth trailing effect (Sway).", + "name": "Lerping" + }, + { + "value": "-15", + "type": "Number", + "label": "Forward Position", + "description": "Sets how far in front of the camera the object is placed. Use negative values to move it further away.", + "name": "Distance" + }, + { + "value": "0.7", + "type": "Number", + "label": "Angular Lerp", + "description": "Controls the interpolation of the rotation. Higher values make the object turn more slowly than the camera (Angular Sway).", + "name": "AngularLerping" + }, + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "", + "type": "Number", + "label": "Roll Offset", + "description": "Adds a base tilt adjustment on the X-axis (Roll). Useful for \"gangsta style\" weapon holds or leaning effects.", + "name": "XElevation" + }, + { + "value": "true", + "type": "Boolean", + "label": "Inherit Pitch (Y)", + "description": "Toggles whether the object follows the camera when looking up or down. Usually set to \"Yes\" for FPS weapons.", + "choices": [ + { + "label": "", + "value": "Yes" + }, + { + "label": "", + "value": "No" + } + ], + "name": "EnableYRot" + }, + { + "value": "true", + "type": "Boolean", + "label": "Inherit Roll (X)", + "description": "Toggles whether the object follows the camera's tilt. Setting this to \"No\" keeps the item vertically stable.", + "choices": [ + { + "label": "", + "value": "Yes" + }, + { + "label": "", + "value": "No" + } + ], + "name": "EnableXRot" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "EnableXRot" + }, + { + "propertyName": "EnableYRot" + }, + { + "propertyName": "XElevation" + }, + { + "propertyName": "Object3D" + }, + { + "propertyName": "AngularLerping" + }, + { + "propertyName": "Lerping" + }, + { + "propertyName": "AngleOffset" + }, + { + "propertyName": "ElevationOffset" + }, + { + "propertyName": "HorizontalOffset" + }, + { + "propertyName": "VerticalOffset" + }, + { + "propertyName": "Rotate" + }, + { + "propertyName": "Distance" + } + ] + } + }, + { + "description": "Automates procedural animations for viewmodels (like weapons). It uses mathematical oscillators to simulate walking movement and provides interpolation actions to smoothly transition between states, such as moving from a \"Hip-fire\" position to an \"Aim-Down-Sights\" (ADS) position.", + "fullName": "FPS Animation", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXBpc3RvbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik03LDVIMjNWOUgyMlYxMEgxNkExLDEgMCAwLDAgMTUsMTFWMTJBMiwyIDAgMCwxIDEzLDE0SDkuNjJDOS4yNCwxNCA4Ljg5LDE0LjIyIDguNzIsMTQuNTZMNi4yNywxOS40NUM2LjEsMTkuNzkgNS43NiwyMCA1LjM4LDIwSDJDMiwyMCAtMSwyMCAzLDE0QzMsMTQgNiwxMCAyLDEwVjVIM0wzLjUsNEg2LjVMNyw1TTE0LDEyVjExQTEsMSAwIDAsMCAxMywxMEgxMkMxMiwxMCAxMSwxMSAxMiwxMkEyLDIgMCAwLDEgMTAsMTBBMSwxIDAgMCwwIDksMTFWMTJBMSwxIDAgMCwwIDEwLDEzSDEzQTEsMSAwIDAsMCAxNCwxMloiIC8+PC9zdmc+", + "name": "FpsAnimation", + "objectType": "", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/7369f754754433fe517eeb3e645f734d10d1150bf30a27aeffb1e639172aa4ee_pistol.svg", + "eventsFunctions": [ + { + "description": "Creates a procedural looping movement by oscillating the horizontal and vertical offsets of an object. It uses sine waves to simulate the natural up-and-down, side-to-side motion of a character walking or breathing.", + "fullName": "Basic Walk Animation", + "functionType": "Action", + "group": "PreMade", + "name": "WalkAnimation", + "sentence": "Apply walk animation to _PARAM0_: vertical distance _PARAM2_ (time _PARAM4_), horizontal distance _PARAM3_ (time _PARAM5_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FP3D::FPSParenting::VerticalOff" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "FP3D::Oscilate(basey, VerticalDistance, VerticalTime)", + "" + ] + }, + { + "type": { + "value": "FP3D::FPSParenting::HorizontalOffs" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "FP3D::Oscilate(basex, HorizontalDistance, HorizontalTime)", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + }, + { + "description": "How many pixels/units the object moves up and down from its base position", + "name": "VerticalDistance", + "type": "expression" + }, + { + "description": "How many pixels/units the object moves left and right", + "name": "HorizontalDistance", + "type": "expression" + }, + { + "description": "The time of the frequency, lower means faster", + "name": "VerticalTime", + "type": "expression" + }, + { + "description": "The time of the frequency, lower means faster", + "name": "HorizontalTime", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Smoothly rotates an object's local offsets (Yaw, Pitch, and Roll) toward target values. This is primarily used to simulate recoil, weapon sway when turning, or \"leaning\" mechanics in a first-person perspective.", + "fullName": "Animate Angles Offsets", + "functionType": "Action", + "name": "InterpolateAngles", + "sentence": "Interpolate angles of _PARAM0_: Angle _PARAM2_, Elevation _PARAM3_, X-Elevation _PARAM4_ with lerp _PARAM5_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FP3D::FPSParenting::AngleOff" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "lerpAngle(Object.FPSObjectParenting::AngleOffset(), offsetAngle, lerp)", + "" + ] + }, + { + "type": { + "value": "FP3D::FPSParenting::ElevatioinOff" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "lerpAngle(Object.FPSObjectParenting::ElevationOffset(), offsetElevation, lerp)", + "" + ] + }, + { + "type": { + "value": "FP3D::FPSParenting::XElevatioinOff" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "lerp(Object.FPSObjectParenting::XElevationOffset(), offsetElevationX, lerp)", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + }, + { + "description": "Target Yaw: The horizontal rotation goal", + "name": "offsetAngle", + "type": "expression" + }, + { + "description": "Target Pitch: The vertical tilt goal", + "name": "offsetElevation", + "type": "expression" + }, + { + "description": "Target Roll: The side-to-side tilt goal", + "name": "offsetElevationX", + "type": "expression" + }, + { + "description": "Speed: 0 is instant, 0.1 is smooth, 0.01 is very heavy/slow", + "name": "lerp", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FP3D::FpsAnimation::ResetBases" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Smoothly transitions the object's local offsets (Horizontal, Vertical, and Distance) towards new target values. This is the primary tool for creating \"Aim Down Sights\" (ADS) transitions, weapon drawing/holstering animations, and sprinting offsets.", + "fullName": "Animate Positions Offsets", + "functionType": "Action", + "name": "InterpolatePositions", + "sentence": "Interpolate positions of _PARAM0_: Horizontal _PARAM2_, Vertical _PARAM3_, Distance _PARAM4_ with lerp _PARAM5_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FP3D::FPSParenting::HorizontalOffs" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "lerp(Object.FPSObjectParenting::HorizontalOffset(), HorizontalOffset, lerp)", + "" + ] + }, + { + "type": { + "value": "FP3D::FPSParenting::VerticalOff" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "lerp(Object.FPSObjectParenting::VerticalOffset(), VerticalOffset, lerp)", + "" + ] + }, + { + "type": { + "value": "FP3D::FPSParenting::Distance2" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "lerp(Object.FPSObjectParenting::Distance(), DIstance, lerp)", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "basex", + "=", + "Object.FPSObjectParenting::HorizontalOffset()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "baseElevation", + "=", + "Object.FPSObjectParenting::ElevationOffset()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "basey", + "=", + "Object.FPSObjectParenting::VerticalOffset()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "baseAngle", + "=", + "Object.FPSObjectParenting::AngleOffset()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "baseAngle", + "=", + "Object.FPSObjectParenting::AngleOffset()" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + }, + { + "description": "Target X: The side-to-side goal (0 is center)", + "name": "HorizontalOffset", + "type": "expression" + }, + { + "description": "Target Y: The up-and-down goal", + "name": "VerticalOffset", + "type": "expression" + }, + { + "description": "Target Z: The depth/zoom goal", + "name": "DIstance", + "type": "expression" + }, + { + "description": "Speed: Smoothing factor (e.g., 0.1 for smooth, 0.3 for snappy)", + "name": "lerp", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "base forward distance of the object.", + "fullName": "Base Distance", + "functionType": "ExpressionAndCondition", + "name": "BaseDistance", + "sentence": "Base forward distance", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "baseDistance" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "base elevation angle.", + "fullName": "Base Elevation (pitch)", + "functionType": "ExpressionAndCondition", + "name": "BaseElevation", + "sentence": "Base elevation angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "baseElevation" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "base vertical position of the object.", + "fullName": "Base Vertical Position", + "functionType": "ExpressionAndCondition", + "name": "BaseY", + "sentence": "Base vertical position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "basey" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "base horizontal position.", + "fullName": "Base Horizontal Position", + "functionType": "ExpressionAndCondition", + "name": "BaseX", + "sentence": "Horizontal position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "basex" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Smoothly transitions the object's distance.", + "fullName": "Animate Distance Offsets", + "functionType": "Action", + "name": "InterpolateDistance", + "sentence": "interpolate distance of _PARAM0_ to _PARAM2_, with lerp of _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FP3D::FPSParenting::Distance2" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "lerp(Object.FPSObjectParenting::Distance(), DIstance, lerp)", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + }, + { + "description": "Target Z: The depth/zoom goal", + "name": "DIstance", + "type": "expression" + }, + { + "description": "Speed: Smoothing factor (e.g., 0.1 for smooth, 0.3 for snappy)", + "name": "lerp", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Smoothly transitions the object's local offsets (Horizontal, Vertical, and Distance) towards new target values. This is the primary tool for creating \"Aim Down Sights\" (ADS) transitions, weapon drawing/holstering animations, and sprinting offsets.", + "fullName": "Animate Horizontal Offsets", + "functionType": "Action", + "name": "InterpolateX", + "sentence": "Horizontal offset of _PARAM0_: to _PARAM2_, with lerp _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FP3D::FPSParenting::HorizontalOffs" + }, + "parameters": [ + "Object", + "FPSObjectParenting", + "=", + "lerp(Object.FPSObjectParenting::HorizontalOffset(), HorizontalOffset, lerp)", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + }, + { + "description": "Target Z: The depth/zoom goal", + "name": "HorizontalOffset", + "type": "expression" + }, + { + "description": "Speed: Smoothing factor (e.g., 0.1 for smooth, 0.3 for snappy)", + "name": "lerp", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Reset bases to the object current value.", + "fullName": "Reset Bases", + "functionType": "Action", + "name": "ResetBases", + "sentence": "Reset all bases values from _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "basex", + "=", + "Object.FPSObjectParenting::HorizontalOffset()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "baseElevation", + "=", + "Object.FPSObjectParenting::ElevationOffset()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "basey", + "=", + "Object.FPSObjectParenting::VerticalOffset()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "baseAngle", + "=", + "Object.FPSObjectParenting::AngleOffset()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "baseAngle", + "=", + "Object.FPSObjectParenting::AngleOffset()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FpsAnimation", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "ResetBases" + }, + { + "functionName": "onCreated" + }, + { + "folderName": "PreMade", + "children": [ + { + "functionName": "WalkAnimation" + } + ] + }, + { + "functionName": "InterpolateAngles" + }, + { + "functionName": "InterpolatePositions" + }, + { + "functionName": "InterpolateDistance" + }, + { + "functionName": "InterpolateX" + }, + { + "functionName": "BaseDistance" + }, + { + "functionName": "BaseElevation" + }, + { + "functionName": "BaseY" + }, + { + "functionName": "BaseX" + } + ] + }, + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "", + "type": "Behavior", + "label": "FPS Parenting", + "extraInformation": [ + "FP3D::FPSParenting" + ], + "choices": [], + "name": "FPSObjectParenting" + }, + { + "value": "", + "type": "Number", + "label": "Base position on X", + "hidden": true, + "name": "basex" + }, + { + "value": "", + "type": "Number", + "label": "Base position on Y", + "hidden": true, + "name": "basey" + }, + { + "value": "", + "type": "Number", + "label": "Base Angle", + "hidden": true, + "name": "baseAngle" + }, + { + "value": "", + "type": "Number", + "label": "Base Elevation on Y", + "hidden": true, + "name": "baseElevation" + }, + { + "value": "", + "type": "Number", + "label": "Base Distance ", + "hidden": true, + "name": "baseDistance" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "baseDistance" + }, + { + "propertyName": "baseElevation" + }, + { + "propertyName": "baseAngle" + }, + { + "propertyName": "basey" + }, + { + "propertyName": "basex" + }, + { + "propertyName": "FPSObjectParenting" + }, + { + "propertyName": "Object3D" + } + ] + } + }, + { + "description": "Make the object stay fixed to an grid.", + "fullName": "Snap To Grid", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZpZXctZ3JpZC1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTMgMTFIMTFWM0gzTTUgNUg5VjlINU0xMyAyMUgyMVYxM0gxM00xNSAxNUgxOVYxOUgxNU0zIDIxSDExVjEzSDNNNSAxNUg5VjE5SDVNMTMgM1YxMUgyMVYzTTE5IDlIMTVWNUgxOVoiIC8+PC9zdmc+", + "name": "SnapToGrid", + "objectType": "", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/13f1838bec4640b71a27e2657f6b0579db215becdf7e2ff2c511cb36d1df3d74_view-grid-outline.svg", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetXY" + }, + "parameters": [ + "Object", + "=", + "(GridSizeX * round((Object.X() - OffsetX) / GridSizeX)) + OffsetX", + "=", + "(GridSizeY * round((Object.Y() - OffsetY) / GridSizeY)) + OffsetY" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetCenterZ" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "(GridSizeZ * round((Object.Object3D::CenterZ() - OffsetZ) / GridSizeZ)) + OffsetZ" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "SnapSize", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Object", + "Resizable", + "=", + "max(GridSizeX, round(Object.Width() / GridSizeX) * GridSizeX)" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Object", + "Resizable", + "=", + "max(GridSizeY, round(Object.Height() / GridSizeY) * GridSizeY)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetDepth" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "max(GridSizeZ, round(Object.Object3D::Depth() / GridSizeZ) * GridSizeZ)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::SnapToGrid", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change grid size from all sides.", + "fullName": "Change Grid Size", + "functionType": "Action", + "name": "ChangeGridSize", + "sentence": "Change the grid size from _PARAM0_, size in X: _PARAM2_; size in Y: _PARAM3_; size in Z _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "GridSizeX", + "=", + "SizeX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "GridSizeY", + "=", + "SizeY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "GridSizeZ", + "=", + "SizeZ" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::SnapToGrid", + "type": "behavior" + }, + { + "description": "The grid size in X axis", + "name": "SizeX", + "type": "expression" + }, + { + "description": "The grid size in Y axis", + "name": "SizeY", + "type": "expression" + }, + { + "description": "The grid size in Z axis", + "name": "SizeZ", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the grid size only in X Axis.", + "fullName": "Change Grid Size X", + "functionType": "Action", + "name": "ChangeGridSizeX", + "sentence": "Change X size from _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "GridSizeX", + "=", + "SizeX" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::SnapToGrid", + "type": "behavior" + }, + { + "description": "Desired size", + "name": "SizeX", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the grid size only on Y Axis.", + "fullName": "Change Grid Size Y", + "functionType": "Action", + "name": "ChangeGridSizeY", + "sentence": "Change Y Size from _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "GridSizeY", + "=", + "SizeY" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::SnapToGrid", + "type": "behavior" + }, + { + "description": "Desired size", + "name": "SizeY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the grid size only on Z axis.", + "fullName": "Change Grid Size Z", + "functionType": "Action", + "name": "ChangeGridSizeZ", + "sentence": "Change Z size from _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "GridSizeZ", + "=", + "SizeZ" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::SnapToGrid", + "type": "behavior" + }, + { + "description": "Desired size", + "name": "SizeZ", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "doStepPostEvents" + }, + { + "functionName": "ChangeGridSize" + }, + { + "functionName": "ChangeGridSizeX" + }, + { + "functionName": "ChangeGridSizeY" + }, + { + "functionName": "ChangeGridSizeZ" + } + ] + }, + "propertyDescriptors": [ + { + "value": "32", + "type": "Number", + "unit": "Pixel", + "label": "Grid Size on X axis", + "name": "GridSizeX" + }, + { + "value": "32", + "type": "Number", + "unit": "Pixel", + "label": "Grid Size on Y Axis", + "name": "GridSizeY" + }, + { + "value": "32", + "type": "Number", + "unit": "Pixel", + "label": "Grid Size on Z axis", + "name": "GridSizeZ" + }, + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Grid offset on X axis", + "name": "OffsetX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Grid offset on Y Axis", + "name": "OffsetY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Grid OFfset on Z axis", + "name": "OffsetZ" + }, + { + "value": "", + "type": "Behavior", + "label": "Resizable objects", + "extraInformation": [ + "ResizableCapability::ResizableBehavior" + ], + "choices": [], + "name": "Resizable" + }, + { + "value": "", + "type": "Boolean", + "label": "Snap the size to the grid", + "description": "Make the size snap to the grid aswell.", + "name": "SnapSize" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "SnapSize" + }, + { + "propertyName": "OffsetZ" + }, + { + "propertyName": "OffsetY" + }, + { + "propertyName": "OffsetX" + }, + { + "propertyName": "GridSizeZ" + }, + { + "propertyName": "GridSizeY" + }, + { + "propertyName": "GridSizeX" + }, + { + "propertyName": "Resizable" + }, + { + "propertyName": "Object3D" + } + ] + } + }, + { + "description": "move object with WASD freely.\nyou will need Mouse Pointer Lock.", + "fullName": "Free Camera Movement", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNhbWVyYS1jb250cm9sIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTksMTJDOSwxMS4xOSA5LjMsMTAuNSA5Ljg5LDkuODlDMTAuNSw5LjMgMTEuMTksOSAxMiw5QzEyLjgxLDkgMTMuNSw5LjMgMTQuMTEsOS44OUMxNC43LDEwLjUgMTUsMTEuMTkgMTUsMTJDMTUsMTIuODEgMTQuNywxMy41IDE0LjExLDE0LjExQzEzLjUsMTQuNyAxMi44MSwxNSAxMiwxNUMxMS4xOSwxNSAxMC41LDE0LjcgOS44OSwxNC4xMUM5LjMsMTMuNSA5LDEyLjgxIDksMTJNNS41Myw4LjQ0TDcuMzEsMTAuMjJMNS41MywxMkw3LjMxLDEzLjc4TDUuNTMsMTUuNTZMMiwxMkw1LjUzLDguNDRNOC40NCwxOC40N0wxMC4yMiwxNi42OUwxMiwxOC40N0wxMy43OCwxNi42OUwxNS41NiwxOC40N0wxMiwyMkw4LjQ0LDE4LjQ3TTE4LjQ3LDE1LjU2TDE2LjY5LDEzLjc4TDE4LjQ3LDEyTDE2LjY5LDEwLjIyTDE4LjQ3LDguNDRMMjIsMTJMMTguNDcsMTUuNTZNMTUuNTYsNS41M0wxMy43OCw3LjMxTDEyLDUuNTNMMTAuMjIsNy4zMUw4LjQ0LDUuNTNMMTIsMkwxNS41Niw1LjUzWiIgLz48L3N2Zz4=", + "name": "FreeCameraMovement", + "objectType": "", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/6743d46652ff5f97742edf3f8d0ef384b7465c53c51d6c375aefbc5a55da4ef6_camera-control.svg", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Forward" + ] + } + ], + "actions": [ + { + "type": { + "value": "FP3D::ForceLinear" + }, + "parameters": [ + "", + "Object", + "Object3D", + "Object.Angle()", + "Object.Object3D::RotationY()", + "Speed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Backward" + ] + } + ], + "actions": [ + { + "type": { + "value": "FP3D::ForceLinear" + }, + "parameters": [ + "", + "Object", + "Object3D", + "Object.Angle()", + "Object.Object3D::RotationY()", + "-Speed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Left" + ] + } + ], + "actions": [ + { + "type": { + "value": "FP3D::ForceLinear" + }, + "parameters": [ + "", + "Object", + "Object3D", + "Object.Angle()-90", + "0", + "Speed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "KeyFromTextPressed" + }, + "parameters": [ + "", + "Right" + ] + } + ], + "actions": [ + { + "type": { + "value": "FP3D::ForceLinear" + }, + "parameters": [ + "", + "Object", + "Object3D", + "Object.Angle()+90", + "0", + "Speed", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FreeCameraMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "speed from object.", + "fullName": "Speed", + "functionType": "ExpressionAndCondition", + "name": "Speed", + "sentence": "speed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Speed" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FreeCameraMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Speed", + "name": "ChangeSpeed", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Speed", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FP3D::FreeCameraMovement", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "doStepPostEvents" + }, + { + "functionName": "Speed" + }, + { + "functionName": "ChangeSpeed" + } + ] + }, + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "choices": [], + "name": "Object3D" + }, + { + "value": "w", + "type": "String", + "label": "Forward Key", + "name": "Forward" + }, + { + "value": "s", + "type": "String", + "label": "Backward key", + "name": "Backward" + }, + { + "value": "a", + "type": "String", + "label": "Left Key", + "name": "Left" + }, + { + "value": "d", + "type": "String", + "label": "Right key", + "name": "Right" + }, + { + "value": "40", + "type": "Number", + "unit": "PixelSpeed", + "label": "Speed of the object", + "name": "Speed" + }, + { + "value": "Space", + "type": "String", + "label": "Up key", + "name": "Up" + }, + { + "value": "LeftControl", + "type": "String", + "label": "Down key", + "name": "Down" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "Speed" + }, + { + "propertyName": "Forward" + }, + { + "propertyName": "Backward" + }, + { + "propertyName": "Left" + }, + { + "propertyName": "Right" + }, + { + "propertyName": "Up" + }, + { + "propertyName": "Down" + }, + { + "propertyName": "Object3D" + } + ] + } + } + ], + "eventsBasedObjects": [] +}