Documentation - Permission System

Main > Documentation - Permission System

Contents

Script Info

Script to handle permissions of players in a world.

Installation

See Install Guides for installation instructions.

Examples Location

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

Setup

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.

Manager

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.
cc7182e8171b6f1c4ed75e1be0f5f64a.png

Notes:

Groups

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.
0ff771252ccfec256ca4e35db312221e.png

Now select the new group you just created.
7cb9e7e8e7a0dca1e8b12b5e74da26e8.png

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.
Unity_2023-08-11_21-15-26.gif
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.
7d3a8705126c4e89b22904d852265b6d.png

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.
adc83bdab273cca4054610352516f29b.png

!!! — Important Notes — !!!

Actions

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.
c1c17eb8d498434202b1b63e42cb8119.png

First create a new object. (I like creating all my actions inside one object for organization but you can create them anywhere you like)
75cccd588d90d35abd18714401e24c44.png
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.
9fee28325f0aa950298067d885927e2e.png

Now you should see a large number of options available to you.
0890a080e4405addc875f4fbea428b9b.png
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.
13eb20733a848f26bdd062fcba413c66.png

Now that we have one action setup we can duplicate it and quickly setup another one for the VIP door.
912447b414ca449fbcd370cc01c14842.png
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:

Join Audio

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.
a5793a29c9544d7a9d33f6d9299b617c.png

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:

Group Display

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.
5463befd8d1ae73fe80934325ac79787.png

Notes:

Guest Access

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.
bea59853ecc359250f2d5c00f50848f9.png
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.
6e35bae218636e7ff36d48cfe938740d.png

Notes:

Permission Priorities (Advanced)

This section is unfinished.