Use Action

Use Action is used in situations where the user must use an object to complete the Action. There are different types of usages from which the user can select, which are,

  • Simple

    The user must hold the interactable object in a specific area for a specified amount of time.

  • UseWithTool

    The user must hold the interactable object in a specific area for a specified amount of time while also holding the trigger button for activating the object.

  • Hit

    The user must collide the interactable object with a specific area for a specific amount of times with enough force.

Example of Use Action Script:

UseActorTool

Action Script Explanation

  1. Set Use Prefab

    1.1. Sets the blueprint actor user needs to take and place it on the use collider to perform the Action.

    1.2. Sets the collider blueprint that the ‘Use Actor’ will interact to complete the action.

    1.3. You can specify a parent in order for the collider to be spawned as its child.

    1.4. In cases where the use actor is already in the scene, e.g. due to being used in a previous action, you can tick the Use Prefab Already Exists option and it will not be spawned a second time.

  2. Collider Prefab Constructor

    The UseColliderPrefabConstructor component must be added on the collider actor. You can read more about this constructor in Use Collider Prefab Constructor.

  3. Set Hologram Object

    Spawns the hologram from the specified path.

Depending on the behaviour needed to complete the action the user needs to set the corresponding field in the Collider Trigger property of the UseColliderPrefabConstructor component. Based on the above setting different properties will be used from the Constructor.

  • Stay Time

    This is used for Simple or UseWithTool trigger colliders. It defines the time the user needs to hold the object inside the trigger.

  • Hit Times

    This is used for Hit trigger colliders. It defines the number of times the user needs to hit the box.

  • Hit Force

    This is used for Hit trigger colliders. It defines the force needed for each hit to register.

  • Hit Movement

    This is used for Hit trigger colliders. The offset that will be applied to the collider after each hit.

Adding More to it

A more advanced example is the following:

UseActorTool

In this example we add one animation that will be played at the end of the action on the patient and another one that will be played in case we undo this action.