You can interact with Players in your world through the VRCPlayerApi. Each Player has a VRCPlayerApi Object, and your world fires the OnPlayerJoined / OnPlayerLeft events on any UdonBehaviours that listen for them when a player joins or leaves.
This page includes info on using some general nodes. Since there are so many things you can do with the VRCPlayerApi object, we've grouped some node info together on the following pages:
- Getting Players
- Player Positions
- Player Forces
- Player Collisions
- Player Audio
- Player Avatar Scaling
- Player Events
Generally Useful Nodes
VRCPlayerApi, Boolean Before you try to get or set anything on a Player, check whether IsValid returns true. If a player has left since you saved a reference to them, this will return False. For easier use on the graph, search for the generic "IsValid" method which works for any Object, since it gives you separate flows for True and False.
VRCPlayerApi, Boolean Turn off the Player's ability to pickup and use VRCPickup objects in the world. This property is on by default, so you only need to use the method if you want to turn it off.
VRCPlayerApi Get the name displayed for the Player (can be different than Username, which is used to log into VRChat and not exposed publicly)
in: VRCPlayerApi out: Boolean Tells you whether the given Player is the local one.
in: VRCPlayerApi out: Boolean Tells you whether the given Player is the Master player. This is the player who either created the instance, or the one who inherited Master status when the last Master left.
in: VRCPlayerApi, Hand (none, left, right) out: VRCPickup Gets the pickup a Player is holding in the specified hand. Only works for the Local Player. Returns null if no VRCPickup is found.
in: VRCPlayerApi, GameObject out: Boolean Tells you whether a Player is the Owner of a given GameObject, important for Sync.
in: VRCPlayerApi out: Boolean Tells you whether a Player is using a VR headset.
VRCPlayerApi, Hand, float, float, float Vibrate the Player's Haptic controllers if they have them. The float inputs should be in the range 0-1. duration is the amount of time that they vibrate, amplitude is the strength with which they vibrate, and frequency is the speed at which they vibrate. The feeling can vary quite a bit between controllers.
VRCPlayerApi Makes the player get into the Station which is on the same GameObject as this UdonBehaviour.
float The simulation time of a player.
VRCPlayerApi NOT RECOMMENDED - turns on legacy locomotion for this player.
The following nodes are Under Review - not working, not recommended for use. We're evaluating their usefulness and they should be ignored for now:
Switching Languages is not yet ready in the VRChat client, these methods will return example data until the full feature is launched. They will currently throw an exception when testing in ClientSim, as well.
string Gets the selected language of the local user.
string Gets all available languages a player can select.