Part of World Components

VRC_Station Description


This component is used to create chairs for worlds and avatars. An example is included in the SDK under the name VRCChair. The default chair will give the player an interact which when clicked will move the player to the chair's Enter Location position and also give the player a seated animation. When the player moves, they will exit the station and go back to their normal standing animations.

Note that Triggers are not actually necessary to seat players into chairs, but can be used to change the interaction range if desired. Additionally, a non-solid box collider will be added to the object at runtime if there is no collider on it already.

Parameters


Parameter Description
Player Mobility Defines player movement inside the station:
Mobile - Allow users to move when seated in station. This option doesn't seem to do anything unless Disable Station Exit is enabled
Immobilize - Prevents user from moving while in the station. This is recommended for most chairs
Immobilize For Vehicle - Same as Immobilized but optimized for moving stations
Can Use Station From Station If the user can switch stations when sitting in a station. This option is not recommended because the act of switching from one station to another leads to strange behaviors. This can include breaking avatar IK, incorrect rotation of the station, and the player position being updated as if they weren't attached to a seat
Animation Controller Used to override normal seating animations with a custom one. This can be an animation controller or an animation override controller
Disable Station Exit If the player cannot exit the station by moving. Use Triggers and SendRPC ExitStation to remove players from the station instead
Seated Is this a station that the user should be sitting in? If true some optimizations will be done to make seated avatars look better. This is recommended for most chairs but should be disabled for dance pad style stations
Station Enter Player Location Object used to define where the user should be transported to when seated. The Z axis (blue arrow) is the forward facing direction and the Y axis (green arrow) is the up facing direction. If left undefined, the station object itself will be used instead. Note that this position will line up with the avatar's origin point (typically the feet). This object does not need to be a child of the station and can be anywhere in the hierarchy
Station Exit Player Location Object used to define where the user should be transported to when they are unseated. The Z axis (blue arrow) is the forward facing direction. If left undefined, the station object itself will be used instead. Note that this position will line up with the avatar's origin point (typically the feet). This object does not need to be a child of the station and can be anywhere in the hierarchy
Controls Object This is used for having a station where you can control an object, such as vehicles. This is legacy and should not be used
On Remote Player Enter Station Object used to activate a Custom Trigger when another player enters the station. As this trigger method is very susceptible Oversyncing, it is recommended to make the Broadcast Type Local or use On Local Player Enter Station instead
On Local Player Enter Station Object used to activate a Custom Trigger when the local player enters the station
On Remote Player Exit Station Object used to activate a Custom Trigger when another player exits the station. As this trigger method is very susceptible Oversyncing, it is recommended to make the Broadcast Type Local or use On Local Player Exit Station instead
On Local Player Exit Station Object used to activate a Custom Trigger when the local player exits the station

Selection Highlight


Stations use the VRC_Trigger OnInteract selection outline rules:

  • All enabled Mesh Renderers on the object or on children of the object will be used to make the Highlight. If any of them are marked as batching static, they will be ignored.
  • Skinned Mesh Renderers cannot be used for Highlights. If your object is a Skinned Mesh, either switch to using a Mesh Filter with a Mesh Renderer or use a Mesh Collider to fake the Highlight instead. Note that when using a Mesh Collider, you cannot use the Is Trigger option unless it is set to Convex, which will ruin your shape. For these cases you can set the Layer to Player or Walkthrough in order to make it non-solid.
  • If no Mesh Renderers are found, any colliders on the same object will be used instead. If there are multiple colliders on the same object as the Interact, whichever one is higher up on the inspector list will be used for the highlight. However, all of them can still be used to activate the Interact even if they don't highlight. Conversely, any colliders on children of the Interact object are completely ignored when it comes to both highlighting and interacting.

Stations With Triggers


When using the SendRPC action with Triggers, you can call a few methods on the station itself:

RPC Description
UseStation Force a player to enter the station. The broadcast type should always be set to Local as you cannot force another player into a station. This method only works on the local player and if the local player is the instigator. See Triggers for more information on instigators
ExitStation Force a player to exit the station. The broadcast type should always be set to Local as you cannot force another player out of a station. This method only works on the local player and if the local player is the instigator. See Triggers for more information on instigators

The VRC_Station script also sends events to the VRC_Trigger script that you can react to. These are somewhat redundant as you can also use the custom trigger slots in the VRC_Station script itself:

Event Description
OnStationEntered This event will fire for all players when anyone enters the station. If you need the event to only fire for the player that entered the station, use the On Local Player Enter Station Custom Trigger option within the VRC_Station script itself
OnStationExited This event will fire for all players when anyone exits the station. If you need the event to only fire for the player that exited the station, use the On Local Player Exit Station Custom Trigger option within the VRC_Station script itself

How to Setup for Worlds


1. Drag and drop the VRCChair prefab into your scene and delete both Cube children objects.

2. Drag and drop in your own mesh as a child of the VRCChair (It's recommended that you mark this object as Static unless needed otherwise).

3. Give the VRCChair object your collider of choice and resize it to fit the seat of your chair. This will make up the Selection Highlight for your chair. For more details on how the Selection Highlight works, refer to the earlier section. It is recommended to mark your collider as IsTrigger so that players do not collide with it.

4. The Enter Point child object is the location the player will sit and can be anywhere in the world. The Z axis (blue arrow) indicates the forward facing direction and the Y axis (green arrow) indicates the up facing direction. Additionally, note that this object will line up with the avatar's origin point (normally the feet), meaning that avatars of different heights will sit in it differently (Splink's Fixed Chair prefab can be used to correct this by putting the Fixed_Seat controller into the Animation Controller slot. This will line up the avatar's hip bone with the Enter Point object, at the cost of custom animations from the avatar). Re-position this object as is necessary for your chair.

5. The Exit Point child object is the location the player will be teleported to when they get out of the Station and follows the same rules as noted for the Enter Point. Re-position it as is necessary for your chair.

6. The VRC_Trigger component is not actually necessary for the Station to work, but should be kept if you want to change the interaction range with the Proximity. Note that the Broadcast Type does not need to be AlwaysBufferOne and can actually be Local (Advanced Mode must be checked in order to see this option).

7. As a bonus, the Animator Controller option allows you to change what the seated animation looks like for the player. You can use a single animation here or the avatar animation override if you want to also change the gestures for the player. Some of the many requests people ask relating to stations is how to make dance pads or how to make a player lie down. Both of these can be achieved with an animation that disables IK on the player and then has an animation forcing the player's positions either lying down, or dancing. Check the prefab database for Splink's Dance Pads to see an example.

How to Setup for Avatars


Chairs for avatars have to be custom made, as the chair prefab found in the SDK uses Triggers which cannot be used on avatars. However, the process is very simple:

1. Begin by placing an empty gameobject somewhere on your avatar and give it the VRC_Station component. Note that this object does not define where a player will actually sit, but rather just the Interact for it.

2. Most of the Station settings can be left as default, with exception to Can Use Station From Station, which as noted above can cause issues. Otherwise, keep Player Mobility as Immobilize, and make sure Seated is enabled. Note that enabling Disable Station Exit will not work as the SDK enforces that it be kept off.

3. Create another empty gameobject on your avatar and assign it as the Station Enter Player Location. This will be the location a player will sit and can be anywhere on the avatar. The Z axis (blue arrow) indicates the forward facing direction and the Y axis (green arrow) indicates the up facing direction. Additionally, note that this object will line up with the avatar's origin point (normally the feet), meaning that avatars of different heights will sit in it differently. Splink's Fixed Chair prefab can also be used to correct this by putting the Fixed_Seat controller into the Animation Controller slot. This will line up the avatar's hip bone with the Enter Location object, at the cost of custom animations from the avatar. If no object is specified, the VRC_Station object itself will be used instead. Additionally, if your Enter Location object and VRC_Station object are 2 or more meters apart the station will be disabled in-game. Note that due to a bug, currently if you specify an Enter Location but no Exit Location on an avatar chair it will bug out your SDK Build Window. For more information, see this canny post.

4. Specify an object to use as the Station Exit Player Location. This can be the same object you used for your Station Enter Player Location, the VRC_Station object itself, or any other object on your avatar. If no object is specified, the VRC_Station object itself will be used instead. However due to the aforementioned bug, you must specify an Exit object if you specified an Enter object.

5. Give your VRC_Station object a collider. This collider will create the shape of the interaction highlight for your chair and will not affect your avatar performance ranking. Colliders on the same object as a VRC_Station component will become non-solid at runtime (regardless of whether IsTrigger is enabled or not) and will not be counted as Physics Colliders by the Performance Ranking System. If you do not add a collider, a box collider will be added to the VRC_Station at runtime.

6. Resize your VRC_Station object or your collider so it fits properly onto your model. It's recommended to not make your collider too big or you may find players constantly sitting on you by accidentally interacting with it.

7. If you want the ability to toggle the chair or kick people off, you will need to create animations for it. Disabling the VRC_Station object will prevent players from sitting on it and will kick out the current occupant. Disabling the collider component will prevent players from being able to sit on it but will not kick off anyone currently sitting in it.

8. Additionally, note that you can only have a maximum of 6 VRC_Station components on your avatar. Any additional stations will be be removed at runtime.

References:


https://docs.vrchat.com/docs/vrc_station