SModularVehicle
On this classForceSetOwner
| Function | ForceSetOwner | Force player of the id owned this vehicle, but only between this spawned vehicle. |
| Function | ForceActivate | Force player drive on this vehicle |
| Function | ForceDeactivate | Force player out of the vehicle. |
| Function | SuppressTimeout | Disable the vehicle automatic respawn |
| Function | OverrideOnClick | Add onClick method to this vehicle,onClick have to be a closure. |
| Property | VerticalInput | Force vertical offset value, it would be added to vertical control and never set to zero. |
| Property | HorizontalInput | Force horizontal offset value, it would be added to horizontal control and never set to zero. |
| Property | StrafeInput | Force strafe offset value,it would be added to strafe control and never set to zero. |
| Property | DepthInput | Force depth offset value, it would be added to depth control and never set to zero. |
| Property | IgnoreUserInput | If this option is enabled, user input would be ignored until disable this. |
| Property | Driver | Get the player avatar component. |
| Property | GameObject | Returns the GameObject of this Vehicle component. |
Functions
ForceSetOwner
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.
Parameters
| Name | Type | Default |
|---|---|---|
| newOwner | int | – |
| vehicleId | int | – |
Returns
void
Example
Space.Host.ExecutingObject.Vehicle.ForceSetOwner(AvatarID)
ForceActivate
Force player drive on this vehicle
Returns
void
Example
Space.Host.ExecutingObject.Vehicle.ForceActivate()
ForceDeactivate
Force player out of the vehicle.
Returns
void
Example
Space.Host.ExecutingObject.Vehicle.ForceDeactivate()
SuppressTimeout
Disable the vehicle automatic respawn
Returns
void
Example
Space.Host.ExecutingObject.Vehicle.SuppressTimeout()
OverrideOnClick
Add onClick method to this vehicle,onClick have to be a closure.
Parameters
| Name | Type | Default |
|---|---|---|
| onClick | Closure | – |
Returns
void
Example
Space.Host.ExecutingObject.Vehicle.OverrideOnClick(NewOnClickFunction)
Properties
VerticalInput
Force vertical offset value, it would be added to vertical control and never set to zero.
Example
Space.Host.ExecutingObject.Vehicle.VerticalInput = 0.5
HorizontalInput
Force horizontal offset value, it would be added to horizontal control and never set to zero.
Example
Space.Host.ExecutingObject.Vehicle.HorizontalInput = 0.5
StrafeInput
Force strafe offset value,it would be added to strafe control and never set to zero.
Example
Space.Host.ExecutingObject.Vehicle.StrafeInput = 0.5
DepthInput
Force depth offset value, it would be added to depth control and never set to zero.
Example
Space.Host.ExecutingObject.Vehicle.DepthInput = 0.5
IgnoreUserInput
If this option is enabled, user input would be ignored until disable this.
Example
Space.Host.ExecutingObject.Vehicle.IgnoreUserInput = true
DriverRead only
Get the player avatar component.
Example
DriverAvatar = Space.Host.ExecutingObject.Vehicle.Driver
GameObjectRead only
Returns the GameObject of this Vehicle component.
Example
VehicleGameObject = Space.Host.ExecutingObject.Vehicle.GameObject



