Motion Path Controller
Updated
Moves the entity along a spline: a fly-through, a platform, a patrol.
- Type
comp-motion-path-controller- Script class
MotionPathControllerComponent- Per entity
- One
- Version
- 2.1.0
Read about it in Camera controllers: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
duration |
0 ≤ x ≤ 3600 |
|
lookTarget |
||
points |
||
tension |
-10 ≤ x ≤ 10 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
MotionPathController::end
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Slow motion and pauseA power-up sets Time.scale to 0.3 for 1.5 seconds, slowing everything driven by game time, and Escape pauses and resumes the game.
Press Slow motion to slow the balls for a moment. Click the scene and press Escape to pause, and again to resume.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(MotionPathControllerComponent); if (component) log(component.props);}