MF_B_MobilitySpaceArcade : MF_AbstractMobility
This describes a simple vehicle that flies like an arcade style space ship. Rigidbody not required, but recommended.
To create a proper space arcade vehicle, this script should be on the object at the vehicle’s root level. Next, a child object is needed to control the roll of the ship, and all other objects of the ship should appear as children to the roll object.
Inherited Variables
throttle, monitor, navTarget, useIntercept, interceptForPlatform, navTargetAim, myRigidbody, velocity
monitor will be equal to the throttle setting.
Inherited Methods
UnitVelocity()
Override ModifiedPosition : Vector3 ( pos : Vector3 )
Will return the position but with the y value made to be within the range of heightRange.
Public Variables
rollTransform : Transform
The transform of the roll object. This is the part of the vehicle that controls the bank angle.
If blank, the first child object transform will be assigned as the rollTransform.
turnRate : float
How fast the vehicle can turn in deg/sec.
slowDownForTurns : bool
If true, if the navTarget is more than 10 degrees away from the forward direction of the vehicle, it will begin to reduce thrust as the angle increases to 90 degrees, where thrust will be 0%.
bankRate : float
When the vehicle turns, it will begin to bank. This is the rate of bank in deg/sec.
bankAngleMax : float
The maximum angle the vehicle will bank when at top speed. If speed is less than top speed, the maximum bank angle will be reduced to ½ bankAngleMax as speed approaches 0.
throttleMin : float
The minimum throttle setting as a percentage. Typically 0.
throttleMax : float
The maximum throttle setting as a percentage. Typically 1.
throttleRate : float
The percent of throttle that can change per second.
maintainHeightRange : bool
If true, will attempt to stay at within y axis height of heightRange.
heighRange : Vector2
Position range along the y axis in world space used for maintainHeight. x = low limit, y = high limit.
thrusters : ThrusterArcadeObject[]
An array of thrusters to provide forward movement.
Public Class ThrusterArcadeObject
engine : MF_B_Engine
The maximum force this thruster can apply. All force is applied at the center of the vehicle.
thrustSource : enum ThrustSource { Thruster, Custom }
An optional particle system to use for this thruster.
customThrust : float
The particle speed when at 0% thrust.
thrust : float (Hidden)
The particle speed when at 100% thrust.
Public Methods
Steer : void ( goal : Vector3 )
Will turn and bank the vehicle towards goal.
Move : void ( percent : float )
Will set the thrusters to percent of thrust.
This describes a simple vehicle that flies like an arcade style space ship. Rigidbody not required, but recommended.
To create a proper space arcade vehicle, this script should be on the object at the vehicle’s root level. Next, a child object is needed to control the roll of the ship, and all other objects of the ship should appear as children to the roll object.
Inherited Variables
throttle, monitor, navTarget, useIntercept, interceptForPlatform, navTargetAim, myRigidbody, velocity
monitor will be equal to the throttle setting.
Inherited Methods
UnitVelocity()
Override ModifiedPosition : Vector3 ( pos : Vector3 )
Will return the position but with the y value made to be within the range of heightRange.
Public Variables
rollTransform : Transform
The transform of the roll object. This is the part of the vehicle that controls the bank angle.
If blank, the first child object transform will be assigned as the rollTransform.
turnRate : float
How fast the vehicle can turn in deg/sec.
slowDownForTurns : bool
If true, if the navTarget is more than 10 degrees away from the forward direction of the vehicle, it will begin to reduce thrust as the angle increases to 90 degrees, where thrust will be 0%.
bankRate : float
When the vehicle turns, it will begin to bank. This is the rate of bank in deg/sec.
bankAngleMax : float
The maximum angle the vehicle will bank when at top speed. If speed is less than top speed, the maximum bank angle will be reduced to ½ bankAngleMax as speed approaches 0.
throttleMin : float
The minimum throttle setting as a percentage. Typically 0.
throttleMax : float
The maximum throttle setting as a percentage. Typically 1.
throttleRate : float
The percent of throttle that can change per second.
maintainHeightRange : bool
If true, will attempt to stay at within y axis height of heightRange.
heighRange : Vector2
Position range along the y axis in world space used for maintainHeight. x = low limit, y = high limit.
thrusters : ThrusterArcadeObject[]
An array of thrusters to provide forward movement.
Public Class ThrusterArcadeObject
engine : MF_B_Engine
The maximum force this thruster can apply. All force is applied at the center of the vehicle.
thrustSource : enum ThrustSource { Thruster, Custom }
An optional particle system to use for this thruster.
customThrust : float
The particle speed when at 0% thrust.
thrust : float (Hidden)
The particle speed when at 100% thrust.
Public Methods
Steer : void ( goal : Vector3 )
Will turn and bank the vehicle towards goal.
Move : void ( percent : float )
Will set the thrusters to percent of thrust.