Summary
This script enables the user to control an avatar with a simple set of movement commands.
PlayerController allows the user to toggle between interacting with gravity and encountering
collisions with colliders.
- Namespace
- ASL
.PlayerSystem - Base Types
-
- MonoBehaviour
graph TD
Base0["MonoBehaviour"]-->Type
Type["PlayerController"]
class Type type-node
Syntax
public class PlayerController : MonoBehaviour
Fields
| Name | Constant Value | Summary |
|---|---|---|
| Gravity |
Downward velocity applied to the player when not grounded.
|
|
| Speed |
Speed the player avatar moves
|
|
| ToggleClippingButton |
Button to press to toggle between clipping through objects.
|
|
| ToggleGravityButton |
Button to press to toggle gravity.
|
Methods
| Name | Value | Summary |
|---|---|---|
| setTransEnabled |
void |
The setTransEnabled method assigns the given value
to the transEnabled field.If the value is false then
the player will not be translated with user input from
keyboard keys.
|