Skip to content

Behavior_Tool

Tools are objects that a character picks up and equips. In a scene, you can create as many tools as you want. This Behavior_Tool community component defines the UI icon, handle position, and droppability of your tool. You also configure the animation to play when executing the tool's Ability with this component.

This component includes:

Property Description
Active tool logo An active tool to be used as a combat weapon
RequiresHandle Whether a handle is needed to hold the tool. If this setting is set to True, continue to set the bone point, position, and rotation of the handle.
Droppable Whether the character can drop the tool
Ability list The list of Abilities. An Ability defines how a character uses a tool. An Ability is executed when the trigger is activated, and the character performs a specified animation then. Click Add Ability to create a new Ability. See the following table for Ability properties.

Ability

Property Description
Id The ID of the Ability. An integer between 1 and 100. Must be unique within the scene. To activate an Ability by ID, see YaToolApi.
Name The name of the Ability. To activate an Ability by name, see YaToolApi.
Active mode Determines how the Ability should behave while being executed
  • Block: The Ability cannot be interrupted while being executed and will be the first in queue to be executed.
  • Parallel: The Ability can be executed in parallel with other Abilities.
  • Cancel: The Ability can be interrupted by a Block Ability while being executed.
Duration How long it takes to fully execute the Ability, measured in seconds. A value between 0 and 9999. Default: 0.2.
Interrupt event An event type that interrupts an active Ability
Trigger type The type of Ability trigger.
  • Input: Executes the Ability and its callback when a key is in the key phase
  • Equip: Executes the Ability and its callback whenever the tool is equipped
  • Ability finish: Executes the Ability and its callback when any other Ability finishes. Note that if Executed Ability is set as the trigger condition, only after a specified Ability is completed will the Ability and its callback be executed.
Key code A key for Ability trigger
Key phase
  • Down: Activates the trigger when the key is pressed
  • Up: Activates the trigger when the key is released
Active Ability Triggers when a specified Ability is active. If this setting is set to True, specify an Ability's ID, so when the specified Ability is active, the Ability executes.
Custom property Triggers when a specified custom property of the tool or the tool owner meets the value requirement you set. If this setting is set to True, specify the custom property's name, location, value, and relationship to the value.
Executed Ability Triggers if a specified Ability is executed. If this setting is set to True, specify an Ability's Id.
Cover move mode Determines what behaviors/actions to be overrode when the Ability is being executed.
  • Disable move: Disables the character's movements
  • Disable input: Disables keyboard inputs
Cover camera mode How the camera works when the Ability is being executed
  • Set3RdCameraAimActive: Activates the aim of the third-person camera when there is the Third Person Mode CameraSetting component or no camera component used in the scene.
Animator IK mode The Inverse Kinematics (IK) allows a specific body part to move with the tool.
  • AimIK: When aiming towards the crosshair, the hand IK is enabled so that the character's hand(s) can move with the tool.
Cover control mode Controls the character's orientation when the Ability is being executed
  • TowardsCameraForward: The character's forward direction follows that of the camera on the X-Y plane.
Parameter A parameter for the API that you want to call later
  • HandlePoint: The position of the handle (float 3)
  • RaycastTargetID: The EntityId of the crosshair target (int)
  • RaycastTargetPart: A certain part of the crosshair target, like head or body (int)
  • PressedDuration: The length of time that the key code is pressed (float)
Animation picker The type of animation to play when the Ability is executed. Select Built-in for a built-in animation, or Select for an owned animation in Asset Library.
Animation The animation to play when the Ability is executed
Motion mode The character's motion mode.
  • Handheld: The character moves when the tool is handheld.
Audio An audio from Asset Library to play when the Ability is executed