Next: Spin Motor, Previous: Simple Motor, Up: Motion [Contents][Index]
This component is a player input controller allowing the user to fly in all directions, truly utilizing 3D space. It takes input from the user, processes it for precision, and applies it as force to the attached Rigidbody
To use, add to the base object that you want the player to fly. If this is a multiplayer game, localize it as a Local Component ([N]etworking tab). Adjust the thrust amount for each direction
float sidewaysThrustHow much thrusting power do we have in the sideways directions?
Default value: 10.0f
float reverseThrustHow much thrusting power do we have in the reverse direction?
Default value: 10.0f
float upwardThrustHow much thrusting power do we have in the upward direction?
Default value: 10.0f
float downwardThrustHow much thrusting power do we have in the downward direction?
Default value: 10.0f
float deadzoneHow much dead space is in the center of the control stick
Default value: 0.25f
KeyCode upKeyA key which, when pressed, applies our Upward Thrust
Default value: KeyCode.Space
KeyCode downKeyA key which, when pressed, applies our Downward Thrust
Default value: KeyCode.LeftShift
bool useLateUpdateShould we update input after the main loop instead of during? Physical thrust is still applied during physics’ Fixed Update loop.
Default value: true
Rigidbody bodyThe rigidbody we will be applying force to
float sidewaysThrustHow much thrusting power do we have in the sideways directions?
Default value: 10.0f
float reverseThrustHow much thrusting power do we have in the reverse direction?
Default value: 10.0f
float upwardThrustHow much thrusting power do we have in the upward direction?
Default value: 10.0f
float downwardThrustHow much thrusting power do we have in the downward direction?
Default value: 10.0f
float deadzoneHow much dead space is in the center of the control stick
Default value: 0.25f
KeyCode upKeyA key which, when pressed, applies our Upward Thrust
Default value: KeyCode.Space
KeyCode downKeyA key which, when pressed, applies our Downward Thrust
Default value: KeyCode.LeftShift
bool useLateUpdateShould we update input after the main loop instead of during? Physical thrust is still applied during physics’ Fixed Update loop.
Default value: true
Rigidbody bodyThe rigidbody we will be applying force to
Next: Spin Motor, Previous: Simple Motor, Up: Motion [Contents][Index]