BrushButtonComponent
The BrushButtonComponent is a customizable button component for interactive gameplay. It allows designers to set up buttons with locking, unlocking, pressing, and resetting capabilities based on various conditions. It is applied for StaticMesh actor for example model created in Unreal Engine Modeling Tools.
Of course you can also use imported model but animations will be not supported!
TODO:
This component should have texture animation handling. When button is pressed, texture should change
Component Properties
Primary Properties
bLocked
Controls if the button is locked. Whentrue
, interactions are restricted, and theOnUseLocked
event is triggered if interaction is attempted.bOnlyOnce
Determines if the button can only be used once. Whentrue
, the button disables further interactions after the first use, andOnPressed
will not fire again.fDelayBeforeReset
Defines the delay (in seconds) after the button can be used again.
Audio Properties
PressSound
The sound that plays when the button is successfully pressed.LockSound
The sound that plays when the button is locked.UnlockSound
The sound that plays when the button is unlocked.UseLockedSound
The sound that plays when an attempt is made to interact with a locked button.
Events
Output Events
These events trigger under specific conditions and can be linked to other gameplay elements.
OnPressed
Fired only when the button is successfully pressed, provided it’s not locked and has reset based onfDelayBeforeReset
. TheInstigator
parameter represents the actor interacting with the button.OnUseLocked
Triggered when an interaction attempt is made on a locked button.Instigator
refers to the actor that tried to interact.OnLocked
Fires when the button is locked.Instigator
refers to the actor that initiated the lock.OnUnlocked
Fires when the button is unlocked.Instigator
refers to the actor that initiated the unlock.OnUsed
Fires whenever an interaction attempt occurs, regardless of the button’s state (locked or unlocked). This event bypassesfDelayBeforeReset
, meaning it triggers on every interaction attempt.Instigator
represents the actor attempting interaction.
Input Actions
These are actions designers can use to control the button’s state and behavior.
Lock(Instigator)
Locks the button, preventing interactions. Fires theOnLocked
event and plays theLockSound
.Instigator
is the actor initiating the lock.Unlock(Instigator)
Unlocks the button, allowing interactions. Fires theOnUnlocked
event and plays theUnlockSound
.Instigator
is the actor initiating the unlock.Press(Instigator)
Simulates pressing the button. Sets the button’s state to “pressed” and fires theOnPressed
event if it’s unlocked.Instigator
is the actor pressing the button.Interact(Instigator)
Attempts an interaction with the button. If the button is locked, it triggersOnUseLocked
; otherwise, it callsPress
. FiresOnUsed
regardless of the button’s state.Instigator
is the actor attempting interaction.