After Spending more time on unreal, I thought I would make a jump back into the unity courses again and retry what I learnt but I seem to be having basic trouble of interacting with a post process volume on trigger.
Step by step breakdown
- Added Post-Process Volume to the main camera.
- Set the trigger to the player transform (Also tried the main camera with a box collider).
- Set the post process layer blending → Layer → post.
- Created a new Post process volume.
- Set the layer to post.
- Box collider changed to is trigger.
Created a c# script and attached to the volume.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
public class UnderwaterEffect : MonoBehaviour
{
public PostProcessVolume postProcessVolume;
private void OnTriggerEnter(Collider other)
{
// Assuming the player has the tag "Player"
if (other.CompareTag("Player"))
{
postProcessVolume.enabled = true;
}
}
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
postProcessVolume.enabled = false;
}
}
}
Other Information:
I Am using Cinemachine camera but I dont think this should be effecting the post process change.
The player character is tagged with player.
I feel like I am doing something so obvioulsy wrong, that I cant even see it. So please any help would be great on this matter