BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider Class Reference
+ Inheritance diagram for BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider:

Detailed Description

Automatically controls the throttle of thrusters based on Raycast collider collisions. If a hit is detected it will Accelerate() the thrusters, otherwise decelerate them. Can be used to Hover, Auto move objects far away, move objects at collision/shot, etc.

A hover can control multiple thrusters and have multiple sensors for better accuracy.

The component is simple, it does not have a stability controller or more complex algorithms, but can be easily extended and creating a new component.

The controller is meant to be used in a 3D environment (requires Collider and Ray/Raycast components). For debuging purposes, the sensors rays are drawed in the Scene editor and colored red when they hit.

Member Data Documentation

◆ thrusters

BThrusterBase [] BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider.thrusters

Which thrusters will be controlled.

◆ sensorsSourceCollider

Collider BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider.sensorsSourceCollider

The sensors(raycast) have origin points on the edge of this collider.

◆ sensorsDirections

Vector3 [] BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider.sensorsDirections

Normalized directions of sensors. See the Scene Gizomo at runtime, all sensors will be drawned Green and Red when they hit a collider.

◆ sensorsLength

float BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider.sensorsLength = 7f

How long the sensors are. Controls the distance between ship and ground.

◆ sensorsLayerMaskRaycast

int BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider.sensorsLayerMaskRaycast = -1

See LayerMask and Physics.Raycast documentation for more details.

◆ sensorsTriggerInteraction

QueryTriggerInteraction BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider.sensorsTriggerInteraction = QueryTriggerInteraction.Collide

Sensors will collider with colliders that are Triggers, or not. See QueryTriggerInteraction docs for more info.

◆ autoStart

bool BArtisan.Thrusters.Helpers.Controllers.BThrusterHoverCollider.autoStart = true

When this GO is activated, it will try to turn ON the thrusters.

◆ debugLog

bool BArtisan.Thrusters.BBaseMonobehaviour.debugLog = false

Enable to debug this component. Warning: it may result in CPU intensive debug messages (each frame).