by fiaKaiera
[ *.unitypackage ] [ *.zip ]
[ Changelog ] [ How to Install? ]
Unity > Package Manager > Add from git URL:
https://github.com/fiaKaiera/vpm-listing.git?path=/Packages/net.fiakaiera.spawnpoints
If installing via
*.zipmake sure you extract the contents into a new folder callednet.fiakaiera.spawnpointsinside your Unity project’sPackagesfolder.
Simply put: It would be appreciated if you credit when you use this asset to fiaKaiera.
It can be in any form as long as it is clear and concise.
Example:
Unique Spawnpoints by fiaKaiera
https://github.com/fiaKaiera/vpm-listing
It’s entirely optional but if you do, it will help spread the word and supports the growth of this asset within the VRChat community.
The system runs on a “Spawnpoint System” component inside a game object. NOTE: You should only have one instance of the Spawnpoint System running as having multiple instances of them will have unintended effects.
SpawnClear()NOTE: The DefaultExecutionOrder of this is set to -1, so other UdonBehaviours can run OnPlayerRespawn() after the spawnpoint system does what its supposed to do.
Public Variables
float overrideSpawnRadius - spawn radius if spawn override is not set to use Scene Descriptor.
string persistentKey - the key used in persistence data.VRCPlayerApi lastRespawnedPlayer - the last player who respawned. Useful with events.These functions can be called through UdonSharp as functions or through “Send Custom Event” in Udon Graph.
Respawn() - Respawns the local player as if they triggered OnPlayerRespawn themselvesThese functions can only be called with arguments
void SpawnSave(int id, bool assignSpawn = true) - saves the local player’s spawnpoint using the index id within persistentSpawns and stores it as an int in PlayerData. If assignSpawn is true, this also sets it as the assigned spawnpoint.void SpawnSave(Transform savepoint, bool assignSpawn = true) - saves the local player’s spawnpoint with a specified Transform within persistentSpawns and stores it as an int in PlayerData. If assignSpawn is true, this also sets it as the assigned spawnpoint.void SpawnSaveAsName(Transform savepoint, bool assignSpawn = true) - saves the local player’s spawnpoint as a string in PlayerData. There should be a Transform with the same name within persistentSpawns for this to properly load. If assignSpawn is true, this also sets it as the assigned spawnpoint.void SpawnSave(Vector3 position, Quaternion rotation, bool assignSpawn = true) - saves the local player’s spawnpoint as a DataList containing 7 floats in PlayerData that specifies the given position then rotation. When loaded, this will create a placeholder transform as the assigned spawnpoint. If assignSpawn is true, this also sets it as the assigned spawnpoint.void SpawnClear(bool assignSpawn = true) - If it exists, sets the local player’s spawnpoint to false in PlayerData. Can be used even with Persistent Savepoints OFF. If assignSpawn is true, this also sets the assigned spawnpoint to null.
PlayerData, so it can only be set to a value that is not null.void AssignSpawn(Transform newSpawn) - Sets the assigned spawn to the given newSpawn.Transform GetAssignedSpawn() - Returns the current assigned spawn. Returns null if there’s nothing assigned.For listeners, these will be the events the spawnpoint system will send.
OnLocalFirstSpawn() - Triggers when the local player first spawns
OnLocalAssignedRespawn(), OnLocalOverrideRespawn(), or OnLocalDefaultRespawn()OnLocalAssignedRespawn() - Triggers when the local player respawns to an assigned spawnpoint. If the owner spawn is set, this will also trigger regardless of owner spawn behaviourOnLocalOverrideRespawn() - Triggers when the local player respawns to an overridden spawnpointOnLocalDefaultRespawn() - Triggers when the local player respawns to a VRC Scene Descriptor spawnpointOnLocalBackupRespawn() - Triggers when the local player respawns twice to a backup respawn
OnLocalAssignedRespawn(), OnLocalOverrideRespawn(), OnLocalDefaultRespawn(), or OnPostRespawn()OnPostRespawn() - Triggers after the player respawns
OnLocalAssignedRespawn(), OnLocalOverrideRespawn(), OnLocalDefaultRespawn(), or OnLocalBackupRespawn()OnLocalSpawnAssigned() - Triggers after the local player’s spawnpoint is assigned
OnLocalSpawnLoaded(), OnLocalSpawnSaved() or OnLocalSpawnCleared()OnLocalSpawnLoaded() - Triggers after the local player’s spawnpoint is loadedOnLocalSpawnSaved() - Triggers after the local player’s spawnpoint is savedOnLocalSpawnCleared() - Triggers after the local player’s spawnpoint is clearedBest report them through the Issues tab.
If you are savvy enough, then you can try making a pull request fixing the issue.
material-symbols-light:location-on from Material Symbols Light, fetched from IcônesThe system is created first for a world called HopCat Hometown (private world) where multiple residents live in the same instance.
This was cleaned up, honed and shared to others through fiaKaiera’s talk A Shared Home: How to Live with Friends in VRChat since there is no powerful solution to having unique spawnpoints.
net.fiakaiera.spawnpoints
https://github.com/fiaKaiera/vpm-listing/blob/main/Packages/net.fiakaiera.spawnpoints/README.md
1.0.1 (Changelog)
2022.3.22f1 or later
No dependencies
No legacy packages
https://github.com/fiaKaiera/vpm-listing/blob/main/Packages/net.fiakaiera.spawnpoints/LICENSE.md