using { /Verse.org } using { /Verse.org/Native } using { /Verse.org/Simulation } using { /Verse.org/SceneGraph } using { /Verse.org/SpatialMath } # Bolt this onto a platform entity to make it rise smoothly at startup. rising_platform_component := class(component): # How far up to rise, in units. A knob in the editor. @editable var RiseHeight:float = 100.0 OnSimulate():void = # Where are we right now, relative to our parent? Start := Entity.GetLocalTransform() # Build a target: same as now, but RiseHeight higher. Target := transform: Translation := vector3: Left := Start.Translation.Left Up := Start.Translation.Up + RiseHeight Forward := Start.Translation.Forward Rotation := Start.Rotation Scale := Start.Scale # Move there, then wait a moment. Entity.SetLocalTransform(Target) Sleep(1.0)