Kanda Players 0.7.0
Loading...
Searching...
No Matches
Grabbing Interactables on PC

In PC interaction, there are several ways to grab entities, all of which requires hovering on them.

  1. Using right mouse button
  2. Using (Q) keyboard button

Grabbing behavior with Q button

Grabbing: Q button works like a toggle, so after hovering on an entity and press Q, the entity will be grabbed. User does not need to keep pressing Q button.

Un-grabbing: While the entity is grabbed by pressing Q button, if the user press Q again or right mouse button, the entity will be ungrabbed.

If the user is not hovering on any entity, then any Q button press will be ignored.

Q Grab Toggle Logic Flow

  1. KeyboardInputSystem and MouseInputSystem gets the keyboard and mouse inputs.
  2. PCRayInteractorInputClientSystem updates the value of interactorInput.IsSecondaryActive depending on if there is a hovered entity, and either of grab toggle or right mouse button is pressed.
  3. Interactions package make use of value of interactorInput.IsSecondaryActive to attach the object to interactor.