URP Setup

Tag & Layer Setup:

  • Make sure to create tags called:

    • InteractiveObject

    • ExaminePoint: Tag for the ExaminePoint gameobject parented to the ExamineCamera

    • InspectPoint: Tag for every single inspect point that exists for an object

  • Create Layers:

    • User Layer 8: ExamineLayer (Doesn't need to be added to objects, referenced in code)

    • User Layer 9: InspectPointLayer (Tag for every single inspect point)

    • User Layer 10: PostProcess

    • User Layer 11: PadlockSpinner

LAYER NOTE: If you can place these on the corresponding User Layers (As above) it is easier for setup, as Unity will automatically place them in the correct places so the below information might not be all relevant to you. (It's worth checking through just encase!)

Installation:

Importing Tips:

  1. Import into a fresh project rather than a working project, to avoid issues

  2. Always keep a backup of your working project BEFORE importing ANY assets

  3. In the Import Unity Package dialog which shows all assets to be imported. DO NOT import project settings -- UNTICK that entire section

Errors On Import:

You will get import errors that refer to Post Processing - We'll fix those below

  • Open the AKUIManager -- Change the top line from:

//FROM THIS
using UnityEngine.Rendering.PostProcessing;

//TO THIS
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
  • AK - UIManager -- Find the GasMask Fields section (Open that out) > Post Processing Effects fields and replace them with:

[SerializeField] private Volume _postProcessingVolume = null;
[SerializeField] private VolumeProfile _originalProfile = null;
[SerializeField] private VolumeProfile _gasMaskProfile = null;
private Vignette _vignette;
private DepthOfField _dof;
  • In the AK - UI Manager -- Inside the Awake() method you will see these lines:

//OLD REFERENCES
_gasMaskProfile.TryGetSettings(out _vignette);
_gasMaskProfile.TryGetSettings(out _dof);

//CHANGE TO THIS
_gasMaskProfile.TryGet(out _vignette);
_gasMaskProfile.TryGet(out _dof);

Open the Demo Scene to get things setup:

I recommend opening the FirstPerson_DemoScene and do the steps below rather than using the prefab at the start (As when compile errors appear, it can cause prefab issues until it's fixed)

Upgrading Materials:

All materials will need updating so please navigate to: Window > Rendering > Render Pipeline Converter and then select:

  • Choose: Built-in to URP from the dropdown

  • Click the Material Upgrade checkbox

  • Then press: Initialize Converters

  • Then select: Convert Assets

Creating New Post Processing:

  1. Go to the Post Processing Volume GameObject (This can be an empty GameObject, so don't worry too much)

    1. Add a Volume component (Specific to URP)

    2. Set it's layer to PostProcess (if not already)

    3. Create a new post processing volume by clicking NEW

      1. Call this "GasMaskURP_PP_Profile" (Or something that you will remember)

        1. Add Vignette: Set the intensity to: 0.485

        2. Add Depth of Field:

          1. Set the Mode to Bokeh

          2. Set Focus Distance to 0.1

        3. Then disable these effects by the main check boxes (These checkboxes are next the names of the effect)

    4. Then you can duplicate the GasMaskURP_PP_Profile or create a new profile called Original_PP_Profile (This is so we can switch between them)

    5. Then open the AK - UIManager object

      1. Open the Gas Mask Properties (By selecting the checkbox next to the Gas Mask Properites)

        1. Add the Volume (Most likely your GameObject called Post Processing Volume - Which has the Volume component on it)

        2. Add the two profiles you just created to these slots for the Gas Mask and Original (You can click the little find box next to each, to find corresponding GameObjects you could use)

Editing The Disable Manager:

  • Open the AKDisableManager script

    • Add the two namespaces to the top of the script:

using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
  • Add these fields:

[Header("Post Processing")]
[SerializeField] private Volume _postProcessingVolume = null;
private DepthOfField _dof;
  • Add this to the Awake() method:

_postProcessingVolume.profile.TryGet(out _dof);
  • In the If(IsExamine) sections add this:

//Turning on (isExamine)
_dof.active = true;
_dof.focusDistance.value = 0.1f;

//Turning off (!isExamine)
_dof.active = false;
_dof.focusDistance.value = 10.0f;

Setting Up Cameras:

  1. Add Layers (They don't need to be on the layers specified but it's an easier setup if that's the case)

    1. User Layer 8: ExamineLayer (Doesn't need to be added to objects, referenced in code)

    2. User Layer 9: InspectPointLayer (Tag for every single inspect point)

    3. User Layer 10: PostProcess

    4. User Layer 11: PadlockSpinner

  2. Select your Main Camera and set the Culling Mask so that you UNTICK the

    1. ExamineLayer

    2. InspectPointLayer

    3. PostProcess

    4. In Rendering TICK the Post Processing checkbox

    5. In the Environment > Volumes > Volume Mask - Add PostProcess

    6. Make sure this has a Physics Raycaster script and the Mask is set to: PadlockSpinner

  3. Select the Examine Camera and make sure the Culling Mask is set to

    1. ExamineLayer & InspectPointLayer

  4. Select the Examine Camera and make sure it’s type is Overlay Camera and NOT Base. (Only one camera, your main camera should be set to Base)

  5. On the Main Camera find the Stack options and click the + icon and now add the ExamineCamera to this slot

Look at the Deferred Rendering section on the left bar if you're having issues whilst using a deferred setup

Checking Prefabs:

  • Go into the Prefabs > Spawnable > Padlock folder and open the brass and black padlocks seperately, select all of the combination spinners and make sure the all have the layer of PadlockSpinner.

Check Examination Objects:

  • Open the Examine - Objects (Child of Puzzle Objects, in the Hierarchy)

    • Find any object which has Inspect Points

    • Make sure these inspect points have a layer of InspectPointLayer (Or they will not render correctly)

Add the Entire Scene Prefab:

  • Drag into your scene the APK_EntireDemoScene_Prefab (Adventure Puzzle Kit > Prefabs > Demo Scene Prefab)

Final Notes:

  • All should be complete and ready to use, if you added the prefab from the folder

Other Issues?

Last updated