Entity/OnUpdate

From Blue Mars Developer Guidebook

Jump to: navigation, search
There are security restrictions on this article

This is a callback in Entity Scripts

Contents

Overview

Function

OnUpdate(deltaTime)
called every frame
deltaTime - last frame time in seconds

Usage

Notes

  • This callback is only called when the entity is activated with Activate

Examples

  • The Bowling script implements the OnUpdate callback to check whether the ball is in the gutter each frame after being thrown.
ARBowlingGame_SP.ThrowBall =
{
  OnBeginState = function(self)
    self:Throw(self.vThrowFwdDir);
    ...
  end,
  OnUpdate = function(self,time)
    ...
    if (self.svEnt:IsEntityInsideArea(AreaId, self.ball.id)) then
      --ball is in the gutter
      ...
Problems with this wiki page? Contact us either by: Support Email or Support Ticket System

Blue Mars Guidebook Privacy Policy
Blue Mars Guidebook Community Guidelines

Personal tools