Base class for player controllers. More...
Public Member Functions | |
abstract void | RegisterInputs (ksInputRegistrar registrar) |
Register all buttons and axes you will be using here. More... | |
virtual void | Initialize () |
Called after properties are initialized. More... | |
abstract void | Update () |
Called every frame. More... | |
virtual new ksPlayerController | Clone () |
Creates a copy of the controller with the value of all members tagged with ksEditable or ksCloneable copied. More... | |
Properties | |
ksInput | Input [get, set] |
Player input. More... | |
ksTransform | Transform [get, set] |
Entity transform. More... | |
ksTransform2D | Transform2D [get, set] |
2D entity transform. More... | |
ksIRigidBody | RigidBody [get, set] |
Entity rigid body. More... | |
ksIRigidBody2D | RigidBody2D [get, set] |
2D entity rigid body. More... | |
ksICharacterController | CharacterController [get, set] |
Character controller. More... | |
ksIEntity | Entity [get, set] |
Entity this player controller is controlling. More... | |
ksTime | Time [get, set] |
Time. More... | |
ksPropertyMap | Properties [get] |
Entity properties. More... | |
ksBasePhysics | Physics [get, set] |
Physics API. More... | |
bool | UseInputPrediction [get, set] |
Should this controller use input prediction? Set this to false in Initialize or in the inspector to disable input prediction. More... | |
abstract uint | Type [get] |
Player controller type. This must be unique-per class and non-zero. More... | |
![]() | |
static ksBaseAssetLoader | Assets [get, set] |
Asset loader singleton. Set this to supply a custom asset loader. More... | |
uint | AssetId [get, set] |
The id of the asset. Zero means it is not an asset. More... | |
string | AssetPath [get, set] |
The asset path. More... | |
bool | IsPrefab [get, set] |
Is this a prefab asset? If true, this is the asset returned by ksBaseAssetLoader.Get<T>(uint, bool). More... | |
string? | AssetName [get] |
The name of the asset. More... | |
Base class for player controllers.
Player controllers allow you to write one class that runs on both the client and the server for controlling entity movement using player inputs. The server uses it for authoritative movement, and the client uses it for prediction/latency masking.
|
virtual |
Creates a copy of the controller with the value of all members tagged with ksEditable or ksCloneable copied.
Arrays, lists, and dictionaries are cloned. Other object references will reference the same object.
Reimplemented from KS.Reactor.ksScriptAsset.
|
virtual |
Called after properties are initialized.
|
pure virtual |
Register all buttons and axes you will be using here.
registrar | Registrar to register with. |
|
pure virtual |
Called every frame.
|
getset |
Character controller.
|
getset |
Entity this player controller is controlling.
|
getset |
Player input.
|
getset |
Physics API.
|
get |
Entity properties.
|
getset |
Entity rigid body.
|
getset |
2D entity rigid body.
|
getset |
Time.
|
getset |
Entity transform.
|
getset |
2D entity transform.
|
get |
Player controller type. This must be unique-per class and non-zero.
|
getset |
Should this controller use input prediction? Set this to false in Initialize or in the inspector to disable input prediction.
Setting this after Initialize is called will do nothing.