VRChat

The VRChat Documentation Hub

Welcome to the VRChat Documentation hub. You'll find comprehensive guides and documentation to help you start working with VRChat as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

VRC_CombatSystem

If added to a scene, health and damage can be added to all players in the scene. Use in conjunction with AddHealth and AddDamage. To target player objects with those trigger actions, leave the target gameobject parameter empty.

Parameter
Description

float maxPlayerHealth

A float, representing the maximum health a player can have.

bool respawnOnDeath

If true, players will automatically respawn to the respawnPoint post death, after repawnTime. If false, respawn must be handled manually.

GameObject respawnPoint

A gameobject representing where players will respawn on death.

float respawnTime

A float, representing the amount of time after player death, after which the player will respawn at the respawnPoint.

bool resetHealthOnRespawn

If true, players' health will be set to maxPlayerHealth upon respawning.

GamObject visualDamagePrefab

A gameobject that spawns when a player takes damage. If empty, there is a default damage indicator.

VRC_Trigger onPlayerKilledTrigger

A trigger that is called with a player's health reaches zero.

VRC_Trigger onPlayerHealedTrigger

A trigger that is called when a player is healed.

VRC_Trigger onPlayerDamagedTrigger

A trigger that is called when a player takes damage.

System.Action<VRC_PlayerApi> onPlayerKilled

A function that is called with a player's health reaches zero. Requires scripting.

System.Action<VRC_PlayerApi> onPlayerHealed

A function that is called when a player is healed. Requires scripting.

System.Action<VRC_PlayerApi> onPlayerDamaged

A function that is called when a player is damaged. Requires scripting.

System.Action<VRC_PlayerApi> onSetupPlayer

A function that is called during player setup. Use this to setup the player. Requires scripting.

VRC_CombatSystem


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.