Riferimento API di nanos world Documentazione italiana non ufficiale
Documentazione ufficiale
Funzione statica Condiviso Veloce

Timer.Bind

Binds a Timer to any Actor. The timer will be automatically cleared when the Actor is destroyed

Non ancora tradotto

Sintassi

Lua
Timer.Bind(timer_id, actor)

Parametri

Nome Tipo Predefinito Descrizione
timer_id integer The Timer ID
actor Actor Actor to be bound

Esempi

Binding a Timer to an Entity
local character = Character(Vector(), Rotator(), "nanos-world::SK_Male"),,local my_timer = Timer.SetTimeout(function(_character),    -- Do something with _character,    -- Ex: Destroy the character after 10 seconds,    _character:Destroy(),end, 10000, character),,-- Binds the Timer to the Character,-- This will ensure it will never trigger if the character is destroyed before it,-- With this you don't need to validate if the '_character' parameter is valid,Timer.Bind(my_timer, character)