Main > Documentation - Permission System
Script to handle permissions of players in a world.
See Install Guides for installation instructions.
Some parts of the documentation will refer to files inside the examples directory. See below for how to find them.
Unity Package install examples this will be under: Assets\RiskyKen\Udon\Utils\Permission System\Examples
Creator Companion install examples will be under: Packages\RiskyKen - Permission System\Examples
The below steps will show you how to setup the permission system and use it’s features. I recommend fully reading both the Manager and Groups sections before jumping ahead. Most of the sections below also have example scenes in Examples\Scenes
if you prefer learning that way.
To get started first we need a manager.
Find the Permission System - Manager
prefab then drag it into your scene.
Now right click it and select Unpack Prefab
.
Notes:
Now we need some groups to split players into, like Staff, VIPs or Supporters.
Find the Permission System - Group
prefab and drag it in also and unpack it. You can place your groups anywhere in the hierarchy, I am placing mines as a child of the manager to keep things organised.
You should now rename the group, for this example I am going to name mines Staff.
Now select the new group you just created.
The first option here links to the 2nd script on this object. We can use this to link a text file to load usernames from. The text file should have 1 username per line Examples/User Lists
has some example files. For this example I am going to drag the staff list in.
A URL can also be used allowing usernames to be updated without reuploading the world. If both a file and URL are set the script will use the file contents until the URL is downloaded.
The other option here colour is purely for organization, I recommend setting a different colour for each group but it’s not required.
Now that we have created 1 group we can easily make more by right clicking our first group and selecting duplicate. Doing this I have created 3 new groups. Create any groups you need, don’t forget to change the text file or URL for the new ones.
The final thing we need to do is select the manager and press Auto Fill Groups
all your groups should now show in it’s permission groups section.
Auto Fill Groups
button should be pressed on the manager to update it’s group list.Now that we have a manager and groups we can add actions to edit the world for players of different groups.
For this example I have create a small world with 3 “rooms”, players can only enter the staff and VIP rooms by clicking on the doors to teleport them. We will setup actions to restrict what players can use the teleports.
First create a new object. (I like creating all my actions inside one object for organization but you can create them anywhere you like)
Now rename the new object, I am calling mines Staff Door Action
.
Now select it and press Add Component
then search for and add Permission System - Action
.
Now you should see a large number of options available to you.
Most of the options here should be self explanatory, when checked they will also provide some extra information.
There are a few way we could stop players entering the staff room like turning off the door or it’s collider. For this example lets turn off it’s intractability so the door is still visible and has a collider. First at the top check the groups we want to have access, for me that will be staff. Next check Change Interacts
and drag the door into the Enable Interacts
array.
The final result should look like this.
Now that we have one action setup we can duplicate it and quickly setup another one for the VIP door.
This time we let staff and both VIP ranks access the door.
With this you can see the power of the action script and all the options it provides. Try playing about with some of it’s different options but I would not recommend changing the priority or forbidden mode options until you have read Permission Priorities (Advanced)
Notes:
The join audio script can be used to play an audio file when a member of a group joins the world.
Find the Permission System - Join Audio
prefab and drag it in also and unpack it. Now select it and press the Auto Set Manager
button.
Now we can select an audio to play in audio clips and set the groups we want this audio to play for.
The Play for All
check box will, play the join audio for all players when someone joins.
The other option here priority is used if the player is in more than 1 group. An example use could be having separate join audio for staff and VIPs, if a player was on both lists the audio with the higher priority number would be used.
Notes:
A group display can be used to display all the players in a group, ideal for displaying a list of your supporters. Group display can also highlight the names of players in the world.
Find the Permission System - Group Display
prefab and drag it in also and unpack it. Now select it and press the Auto Set Manager
button.
Now simply select the group you want to display and we are done.
Notes:
Guest access can be used to temporarily give players access to a group until they leave the world. This could be used for things like supporters giving their friends access to VIP areas or staff letting a DJ access stream controls.
Find the Permission System - Guest Access
prefab and drag it in also and unpack it. Now select it and press the Auto Set Manager
button.
Now we can select what group the players will be temporarily added to.
Creating a separate group for guests is not required but it is recommended.
The colour options at the bottom can be used to better theme the button display for your world.
The last things we will want to do it restrict what players can use the guest access panel so people can’t give themselves guest access. We can easily do this with a permission system action by toggling the guest access child canvas object.
Never turn of the main guest access object, this would stop the script form syncing correctly.
Notes:
This section is unfinished.