VehicleSeat is a part with special functions. A vehicle with a vehicle seat fixed on can be operated and driven. The vehicle seat has three power modes for simulating different types of vehicles.
Create a vehicle seat: Click on the "+" at the bottom of the workspace——Part——VehicleSeat. It can also be created by using the script function RWObject.Create("Part").
Edit a vehicle seat: In the edit mode, click on the vehicle seat's property panel to edit the vehicle seat. VehicleSeat is a part object and has all properties of basic parts. Its own unique properties are shown under "UIVehicleSeat".
VehicleSeat characteristics:
Power mode:
string Name
The custom name of this object.
string ClassName
The object-type name.
RWObject Parent
The parent of this object.
Vector3 Color
Click to open the detailed color adjustment panel.
Enum.MaterialType Material
The material of the part. Each material has its own physical properties.
Vector2 Tiling
The times that the material texture piles on the part surface. The larger the value, the higher the texture density.
Vector2 Offset
The offset of the material texture from the default position.
float Transparency
The transparency of the part.
float AlphaCutoff
The section without texture will display the transparency of the material. AlphaCutoff is the transparency of the basic material texture.
bool VertexColor
Whether to use the original part color.
Vector3 Position
Display the position of an object (global position and relative position).
Vector3 Rotation
Display the global orientation of an object.
Vector3 Scale
The size of an object.
bool IsLock
"Lock" can make an object unselectable in the editing window, but selectable in the manager.
bool Anchored
"Anchor" can remove the effect of physics laws on an object.
bool CanCollide
Whether an object can collide with other objects with the laws of physics.
Vector3 RotVelocity
Current rotation velocity, measured in radians per second. Rotation velocity of the anchored object can be synchronized to the parts or characters that connected to it.
Vector3 Velocity
Current velocity, measured in meters per second. Velocity of the anchored object can be synchronized to the parts or characters that connected to it.
bool IsCustomPhysics
You can define physical properties of the part.
float Density
Density.
float Friction
Friction coefficient. When two objects come into contact, the smaller friction coefficient will be adopted.
float Bounciness
Elasticity coefficient.
float FrictionWeight
Friction Weight, taking effect only when an avatar touches other objects. The higher a friction weight, the greater the influence that the friction coefficient will be affected on the final friction coefficient.
bool UseGravity
Whether to enable gravity.
bool IsCollisionCallBack
Whether to callback the collision.
float Mass
Mass.
Enum.PowerModeType PowerMode
VehicleSeat provides 3 powers. Using velocity or force as a power source means the seat should adopt a split joint with the chassis to apply the power to it. If using the torque as a power source, the vehicle seat should adopt a split joint with the wheel object to apply power to the wheel object.
float SpeedLimit
Speed limit.
float ReverseSpeedLimit
Reverse speed limit.
float ThrottleSensitivity
The larger this value is, the faster the maximum torque output will be reached after inputting the forward or backward instructions.
float SteerSensitivity
The same as throttle. The steering is more sensitive when this value is larger.
float Speed
Its unit is meter/second. Not recommended to exceed 10.
float ReverseSpeed
Its unit is meter/second. Not recommended to exceed 3.
Vector3 MaxForce
The final speed depends on the value and the total mass of the vehicle.
float MaxReverseForce
The final reverse speed depends on the value and the total mass of the vehicle.
float MaxTorque
The final speed depends on the value and the total mass of the vehicle.
float MaxReverseTorque
The final reverse speed depends on the value and the total mass of the vehicle.
int MaxSteerAngle
The maximum angle to which the wheel can steer. If the steering angle is too large, it will affect the steering speed.
float MaxSpeedAngular
Its unit is meter/second. Not recommended to exceed 5.
float MaxForceTorque
The final steering speed depends on the value and the total mass of the vehicle.
Avatar Avatar
Return the avatar object sitting on the driving seat.
Vector3 WorldPosition
Global position.
Vector3 WorldRotation
Global direction.
RWObject.Create(classname)
A special function, creating an instance of the specified class.
DelAllChild()
Deletes all child objects.
Clone()
Clones an object to create a copy.
Destroy()
Delete objects.
GetAncestorByName(Name)
Returns the object's first parent node with the same name.
GetAncestorByClassName(className)
Returns the object's first parent node of the same class.
GetChildByName(Name,recursive)
Returns the object's first child object with the same name. If the second parameter is true, it will search through descendants of all hierarchies.
GetChildByClassName(className,recursive)
Returns the object's first child object of the same type. If the second parameter is true, it will search through descendants of all hierarchies.
GetAllChild()
Seeks all its child objects and returns as a list.
GetAllDescendant()
Recursively seeks all its descendants and returns as a list.
IsClass(ClassName)
Judges whether it is the class the same as the given object class or not.
IsAncestor(TarObj)
Judges whether itself is the ancestor of the target object or not.
IsDescendant(TarObj)
Judges whether itself is the descendant of the target object or not.
WaitForChild(childName,timeout)
Seeks its own child object.
GetMaterialName()
Retrieves the name of its own material. Temporarily cannot be used for the terrain.
Child(childName)
Seeks its own child object by a given name.
Equals(TarObj)
Judges whether the target object is the same as itself or not.
CreateJoint(targetPart, jointType)
Creates a constraint of the specified type between itself and the target object.
GetJointList()
Returns a list of all physical constraints on the object.
DelAllJoint()
Deletes all physical constraints on the object.
GetJointPartList(recursive)
Retrieves all part objects connected with itself by constraints and returns as a list.
GetMass()
Retrieves its own mass.
CanCollideWith()
Returns whether itself is involved in the collision.
Sit(humanoidObj)
Makes the target avatar into riding state.
ClearSitting()
Makes the avatar sitting in the seat exit driving state.
Reset()
Rotates the vehicle seat to return it to (0,0,0), and raise its position for a certain distance.
GetNetworkOwner()
Returns the player who is owning this part.
GetNetworkOwnershipAuto()
Returns whether the ownership of this part is automatically assigned.
SetNetworkOwner(player)
Sets the ownership of this part and all other parts connected to it.
SetNetworkOwnershipAuto()
Makes the game engine automatically handle parts.
GetTriggeringPart()
Returns the other part objects that the part is in contact with.
ChildAdded(childobject)
Triggered when a direct child object is added.
ChildRemoved(childobject)
Deletes all child objects.
DescendantAdded(descendantobject)
Triggered when a descendant is added.
DescendantRemoved(descendantobject)
Triggered when a descendant is removed.
AncestryChanged(AncestryChanged)
Triggered when the ancestry is changed.
CollisionEnter()
Triggered when the object starts a collision.
CollisionExit()
Triggered when the object ends a collision.
TriggerEnter()
Triggered when the object starts a contact.
TriggerExit()
Triggered when the object ends a contact.
JointBreak()
Triggered when the constraint is deleted or bears a break force.
onEnterDriveState()
Triggered when the avatar enters driving state.
onLeaveDriveState()
Triggered when the avatar exits driving state.