Collision Hit Prefab Constructor

The general for these type of prefabs idea matches with the Use Collider mentioned in 5.6., except that it is more tailored to the needs of this type of interaction, hitting. One gameobject that awaits collision with one specific user defined Tool, and on each collision it will translate a small step into the direction given.

A behavior expected also in real life.

The developer must place the prefab to its final position (where it should be after the hits have occurred). Then, on spawn the gameobject will be translated into the opposite direction of the one selected by: total hits * translation per hit.

Variable Name

Type

Description

Tool

enum type of ToolsEnum

Select the user–defined tool for hits

Hit Step

float

Select the amount of translation per hit

Hit Count

float

Select the total hits

Min Magnitude

float

On each hit the script observes from the rigidbodies the strength of the hit. If the strength is below the given minimum magnitude it will ignore the collision.

Vector Direction

enum of all available selections for direction

Select the direction where the gameobject will translate to. In LOCAL Axis.

Collision Time Diff

float

When an accepted collision occurs, the collider will not accept another collision for a limited amount to time to avoid duplicate collisions. This amount of time can be selected with this variable.

Prefab Creation Requirements

  1. Rigidbody

  2. Trigger Collider