📕
Motion Warping for Unity
  • 👋Welcome!
  • concept
    • ⭐Introduction
    • ⚙️How this asset works
  • Fundametals
    • 🔸Motion Warping Asset
    • 🔸Motion Warping Component
    • 🔸Warp Providers
    • 🔸Motion Warping IK
  • Components
    • 🔌Mantle Component
    • 🔌Vault Component
    • 🔌Land Component
    • 🔌Roll Component
    • 🔌Align Component
Powered by GitBook
On this page
  • Overview
  • How does it work?
  • Motion Warping Asset Requirements
  1. Components

Align Component

PreviousRoll Component

Last updated 1 year ago

Overview

This component is used for melee combat and interactions. Add it to the object you want your character to interact with (enemy character, car, etc.):

Interaction Angle: defines the max allowed interaction angle. The system will use the Game Object forward axis.

Offset Angle: yaw rotation offset for the Interaction Angle.

Distance: max allowed interaction distance.

Target Anim Name: name of the animation to play for the object player will interact with. For example: enemy character, car, door, etc.

How does it work?

There are multiple ways to use Align Component, but the most popular one is to get a reference to the interaction target object. For example, let's say that we enter collision box for a car. Now we can use the car Game Object as a paramter in the Interact method:

private void OnTriggerEnter(Collider other)
{
    _interactionTarget = other.gameObject;
}

private void OnTriggerExit(Collider other)
{
    _interactionTarget = null;
}

private void TryInteracting()
{
    _warping.Interact(_interactionTarget);    
}

Motion Warping Asset Requirements

This component only requires 1 Warp Phase to work properly, as the character will go from the current to the target position.

🔌
Align Component.