HoverTurning Component

HoverTurning

The HoverTurning Component is responsible for providing your vehicle’s turning capabilities.

It does this by continually monitoring the Rigidbody’s angular velocity and calculating and applying the physics forces necessary to accurately control the turn rate or cancel unwanted angular momentum.

Inspector Fields

Target Rigid Body

Specifies which Rigidbody instance the component will operate on. If this field is left empty, on startup the HoverTurning component will attempt to obtain a reference to a Rigidbody component on the same GameObject.

Max Turn speed

Sets the maximum turn speed (in degrees per second) along the local Y axis.

hoverturning-inspector

Usage Examples

Using the SetSpeedNormalized function with direct user input to set the turn speed:

 void Update()
{
	var turnController = GetComponent<HoverTurning>();
	var turnSpeed = Input.GetAxis( TurnInputAxis );

	turnController.SetSpeedNormalized( turnSpeed );
} 

Using the TurnSpeed property with user input to set the turn speed:

 void Update()
{
	var turnController = GetComponent<HoverTurning>();
	var turnSpeed = Input.GetAxis( TurnInputAxis );

	turnController.TurnSpeed = turnSpeed * turnController.MaxTurnSpeed;
} 

HoverTurning API Documentation

View the API documentation for the HoverLift Component online