Breakroom is now Sinewave Campus. Book a meeting

SModularVehicle

ClientComposants
Dans cette classeForceSetOwner
  1. Fonctions
  2. ForceSetOwner
  3. ForceActivate
  4. ForceDeactivate
  5. SuppressTimeout
  6. OverrideOnClick
  7. Propriétés
  8. VerticalInput
  9. HorizontalInput
  10. StrafeInput
  11. DepthInput
  12. IgnoreUserInput
  13. Driver
  14. GameObject
Membres 12
FonctionForceSetOwnerForce player of the id owned this vehicle, but only between this spawned vehicle.
FonctionForceActivateForce player drive on this vehicle
FonctionForceDeactivateForce player out of the vehicle.
FonctionSuppressTimeoutDisable the vehicle automatic respawn
FonctionOverrideOnClickAdd onClick method to this vehicle,onClick have to be a closure.
PropriétéVerticalInputForce vertical offset value, it would be added to vertical control and never set to zero.
PropriétéHorizontalInputForce horizontal offset value, it would be added to horizontal control and never set to zero.
PropriétéStrafeInputForce strafe offset value,it would be added to strafe control and never set to zero.
PropriétéDepthInputForce depth offset value, it would be added to depth control and never set to zero.
PropriétéIgnoreUserInputIf this option is enabled, user input would be ignored until disable this.
PropriétéDriverGet the player avatar component.
PropriétéGameObjectReturns the GameObject of this Vehicle component.

Fonctions​

ForceSetOwner​

void ForceSetOwner(int newOwner, int vehicleId)

Force player of the id owned this vehicle, but only between this spawned vehicle. But it seems the new owner can’t drive on this vehicle.

Paramètres

NomTypeValeur par défaut
newOwnerint–
vehicleIdint–

Valeurs de retour

void

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.ForceSetOwner(AvatarID)

ForceActivate​

void ForceActivate()

Force player drive on this vehicle

Valeurs de retour

void

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.ForceActivate()

ForceDeactivate​

void ForceDeactivate()

Force player out of the vehicle.

Valeurs de retour

void

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.ForceDeactivate()

SuppressTimeout​

void SuppressTimeout()

Disable the vehicle automatic respawn

Valeurs de retour

void

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.SuppressTimeout()

OverrideOnClick​

void OverrideOnClick(Closure onClick)

Add onClick method to this vehicle,onClick have to be a closure.

Paramètres

NomTypeValeur par défaut
onClickClosure–

Valeurs de retour

void

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.OverrideOnClick(NewOnClickFunction)

Propriétés​

VerticalInput​

float VerticalInput {get; set; }

Force vertical offset value, it would be added to vertical control and never set to zero.

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.VerticalInput = 0.5

HorizontalInput​

float HorizontalInput {get; set; }

Force horizontal offset value, it would be added to horizontal control and never set to zero.

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.HorizontalInput = 0.5

StrafeInput​

float StrafeInput {get; set; }

Force strafe offset value,it would be added to strafe control and never set to zero.

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.StrafeInput = 0.5

DepthInput​

float DepthInput {get; set; }

Force depth offset value, it would be added to depth control and never set to zero.

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.DepthInput = 0.5

IgnoreUserInput​

bool IgnoreUserInput {get; set; }

If this option is enabled, user input would be ignored until disable this.

Exemple

Lua
Space.Host.ExecutingObject.Vehicle.IgnoreUserInput = true

DriverLecture seule​

SAvatar Driver {get; }

Get the player avatar component.

Exemple

Lua
DriverAvatar = Space.Host.ExecutingObject.Vehicle.Driver

GameObjectLecture seule​

SGameObject GameObject {get; }

Returns the GameObject of this Vehicle component.

Exemple

Lua
VehicleGameObject = Space.Host.ExecutingObject.Vehicle.GameObject