Logic Component: Difference between revisions
Jump to navigation
Jump to search
(Initial content) |
(→Component Settings: Added round start/end triggers) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
The logic component is a [[:Category:Gameplay Components|gameplay component]] that runs a series of [[Action|actions]] | The logic component is a [[:Category:Gameplay Components|gameplay component]] that runs a series of [[Action|actions]] for different [[Event|events]]. | ||
== Component Settings == | |||
[[File:LogicComponent.png|thumb|500px|The Logic Component in the [[Inspector Window]]. You can add multiple events to a single logic component.]] | |||
{| class="wikitable" | |||
|- | |||
! Property !! Description | |||
|- | |||
|'''Event''' || The event that triggers a list of Actions. | |||
|- | |||
| style="padding-left: 2em;" | ''Start'' || Triggered at the start of a minigame, as the countdown begins. | |||
|- | |||
| style="padding-left: 2em;" | ''Enable'' || Triggered each time this gameobject is enabled. This includes: | |||
* being enabled automatically when the object is created as part of the scene as soon as the minigame loads (while still on the minigame load/intro screen) | |||
* each time this gameobject is enabled by a [[Set Active Action]] if it was previously disabled. | |||
|- | |||
| style="padding-left: 2em;" | ''Update'' || Triggered every frame. Not consistent between players due to varying framerates. '''For consistent timed actions use the ''Timer'' event instead.''' | |||
|- | |||
| style="padding-left: 2em;" | ''Hit'' || Triggered when the object this component is attached to is hit by the player or [[Weapon Component|weapons]]. | |||
|- | |||
| style="padding-left: 2em;" | ''Weapon Hit'' || Triggered when the object this component is attached to is hit by a [[Weapon Component|weapon]]. | |||
|- | |||
| style="padding-left: 4em;" | '''Weapon Type''' || The type(s) of weapon hit that will cause the actions to be triggered. | |||
|- | |||
| style="padding-left: 2em;" | ''Timer'' || Triggered every x seconds. | |||
|- | |||
| style="padding-left: 4em;" | '''Interval''' || The number of seconds between the event firing. Use the Arrow beside the ''Interval'' value to set the mode. | |||
|- | |||
| style="padding-left: 6em;" | ''Constant'' || Actions are triggered repeatedly after a set number of seconds. | |||
|- | |||
| style="padding-left: 6em;" | ''Random Between Two Values'' || Actions are triggered repeatedly after a random amount of time. The minimum and maximum amount of time between each firing of the event can be set. | |||
|- | |||
| style="padding-left: 2em;" | ''Round Start'' || Triggered at the start of each minigame round, after the round start countdown. | |||
|- | |||
| style="padding-left: 2em;" | ''Round End'' || Triggered at the end of each minigame round. | |||
|- | |||
| '''Actions''' || The list of actions to run for the given Event. | |||
|- | |||
|} | |||
== Example Usage == | |||
''Start'' can be useful to make something happen when the minigame begins. | |||
''Timer'' with a random ''Interval'' can be used to add random effects to make the minigame more exciting. Use the arrow beside the value to change between constant and random values. | |||
[[Category:Gameplay Components]] | [[Category:Gameplay Components]] | ||
[[Category:Components]] | [[Category:Components]] |
Latest revision as of 20:24, 17 December 2023
The logic component is a gameplay component that runs a series of actions for different events.
Component Settings

The Logic Component in the Inspector Window. You can add multiple events to a single logic component.
Property | Description |
---|---|
Event | The event that triggers a list of Actions. |
Start | Triggered at the start of a minigame, as the countdown begins. |
Enable | Triggered each time this gameobject is enabled. This includes:
|
Update | Triggered every frame. Not consistent between players due to varying framerates. For consistent timed actions use the Timer event instead. |
Hit | Triggered when the object this component is attached to is hit by the player or weapons. |
Weapon Hit | Triggered when the object this component is attached to is hit by a weapon. |
Weapon Type | The type(s) of weapon hit that will cause the actions to be triggered. |
Timer | Triggered every x seconds. |
Interval | The number of seconds between the event firing. Use the Arrow beside the Interval value to set the mode. |
Constant | Actions are triggered repeatedly after a set number of seconds. |
Random Between Two Values | Actions are triggered repeatedly after a random amount of time. The minimum and maximum amount of time between each firing of the event can be set. |
Round Start | Triggered at the start of each minigame round, after the round start countdown. |
Round End | Triggered at the end of each minigame round. |
Actions | The list of actions to run for the given Event. |
Example Usage
Start can be useful to make something happen when the minigame begins.
Timer with a random Interval can be used to add random effects to make the minigame more exciting. Use the arrow beside the value to change between constant and random values.