LateUpdateEvent
Lens Studio v1.0.0+
Scripting Name: LateUpdateEvent
Inherits from SceneEvent
Description
This event is triggered at the end of every frame, after normal UpdateEvents trigger but before rendering occurs.
Methods
getDeltaTime()
: Number
Returns the time elapsed (in seconds) between the current frame and previous frame.
Inherited Methods
bind(function evCallback)
: void
Binds a callback function to this event.
getTypeName()
: String
Returns the typename of the SceneEvent.
getTypeName()
: String
Returns the name of this object’s type.
isOfType(String type)
: Boolean
Returns true if the object matches or derives from the passed in type.
Inherited Properties
enabled
: Boolean
If true, the event is able to trigger. If false, the event will not trigger.
Examples
// Move this SceneObject every frame to match the position of a target SceneObject
//@input SceneObject target
var transform = script.getTransform();
var targetTransform = script.target.getTransform();
var event = script.createEvent("LateUpdateEvent");
event.bind(function (eventData)
{
var targetPos = targetTransform.getWorldPosition();
transform.setWorldPosition(targetPos);
});
Still Looking for help?
Visit Support