Skip to main content

Handling Players Entering And Leaving The Station

Since anyone can enter the station, we need to save the player currently in it to know what logic to perform later.

Create a new VRCPlayerApi variable to store the player in the station. Add the OnStationEntered event, and save the entered player in the variable. Also add the OnStationExited event. Instead of saving the player, set the player variable to null. Also in the station exited event, set the station mobility to Immobilize. This just cleans up in case one player uses it, stops, and another player wants to use it.

StationEnterExit UdonGraphStationEnterExit  UdonSharpStationEnterExit  CyanTrigger