Custom Maps & Logic
  • Custom Map Tutorial
    • Custom Map Introduction
    • Your first map
    • Map Navigation
    • Object Selection
    • Object Positioning
    • Object Attributes
    • Shortcuts and Macros
    • Editor Settings
    • Built-in Components Common Errors
    • Map Performance
    • Custom Assets
      • Your first Asset Bundle
      • Asset Bundles in Map Editor
      • Asset Bundles in Game
      • Adding to Asset Bundles
      • Asset Bundle naming
  • Custom Logic Tutorial
    • Custom Logic Introduction
    • Your first script
    • Variables
    • Types
    • Variable Inspector
    • Expressions
    • Conditionals
    • Loops
    • Functions
    • Coroutines
    • Classes
    • Static Classes
    • Components
    • Extensions
    • Cutscenes
    • Static Objects
    • Networking
    • Commenting
  • Reference
    • Static Classes
      • Game
      • Network
      • Map
      • UI
      • Time
      • Convert
      • String
      • Input
      • Math
      • Random
      • Cutscene
      • Camera
      • RoomData
      • PersistentData
      • Json
      • Physics
    • Objects
      • Component
      • Object
      • Character
      • Human
      • Titan
      • Shifter
      • MapObject
      • Transform
      • Player
      • NetworkView
      • Color
      • Vector3
      • Quaternion
      • Dict
      • List
      • Range
      • LineCastHitResult
      • MapTargetable
      • Random
    • Callbacks
      • Main
      • Components
  • Examples
    • Gamemodes
      • Survive
      • Waves
      • Endless
      • Racing
      • Blade PVP
      • Thunderspear PVP
      • Titan Explode
      • Cranked
      • More Examples
    • Components
      • SupplyStation
      • Daylight
      • PointLight
      • Rigidbody
      • NavMeshObstacle
      • Cannon
      • Dummy
      • Wagon
      • Tag
      • KillRegion
      • DamageRegion
      • MovePingPong
      • RacingCheckpointRegion
      • RacingFinishRegion
      • TeleportRegion
      • Animal
      • SignalMover
      • SignalSender
      • More Examples
Powered by GitBook
On this page
  1. Reference
  2. Callbacks

Main

These callback functions are available on both the Main class and all component classes.

Function
Description

Init()

Called upon class creation

OnGameStart()

Called upon game start

OnTick()

Called every fixed update frame (0.02 seconds)

OnFrame()

Called every update frame

OnLateFrame()

Called after every update frame

OnSecond()

Called every second

OnChatInput(message: string)

Called upon chat input from the player. You can return false in this function to prevent input from being sent to the chat window.

OnPlayerSpawn(player: Player, character: Character)

Called upon any player spawning

OnCharacterSpawn(character: Character)

Called upon any character spawning

OnCharacterReloaded(character: Character)

Called upon any character being reloaded (changing weapon/character model at gas).

OnCharacterDie(victim: Character, killer: Character, killerName: string)

Called upon a character dying. Killer may be null.

OnCharacterDamaged(victim: Character, killer: Character, killerName: string, damage: Int)

Called upon a character being damaged. Killer may be null.

OnPlayerJoin(player: Player)

Called upon a player joining the room

OnPlayerLeave(player: Player)

Called upon a player leaving the room

OnNetworkMessage(sender: Player, message: string)

Called upon receiving Network.SendMessage.

OnButtonClick(buttonName: string)

Called upon a UI button with given name being pressed.

PreviousCallbacksNextComponents

Last updated 5 months ago