onAdd(tag: Tag, action: (obj: GameObj)=>void): KEventController
Register an event that runs when an object with the provided tag is added.
paramtag- The tag to listen for.
paramaction- The function that runs when an object is added.
// This will run when the object is added.
onAdd("player", () => {
debug.log("ohhi");
});
add([
pos(),
"player"
]);
returnsThe event controller.
sincev2000.0
groupEvents
onAdd(action: (obj: GameObj)=>void): KEventController
Register an event that runs when an object is added
paramaction- The function that runs when an object is added.
// This will run when the object is added.
onAdd(() => {
debug.log("ohhi");
});
add([
pos(),
]);
returnsThe event controller.
sincev2000.0
groupEvents