Jump to content

Time of Day overrides / interior controller triggered by Camera position, rather than Character position


mroshaw
Go to solution Solved by Josh,

Recommended Posts

Hello again!

 

I have both Override and Interior Controller volumes in my scene, to accommodate "interior" spaces in buildings.

 

Whilst this works well, I have noticed that the volumes are triggered by the position of the Camera object. My project uses a third person controller (Invector TPS), and the camera is typically offset from the character position, and can rotate independently of the character game object.

 

What happens is that as I move around my interior scene, as the camera gets closer to the blend bounds, the volume applies it's changes. So the room gets light and dark as I move around.

 

Is  there a way to trigger the Override and Interior volumes based on the position / collision with an arbitrary game object layer, such as my Character Controller, rather than the Camera?

 

I suspect this is driven by the Camera "Volume Anchor Override"?

 

UPDATE: Okay, I think this is kind of a bug. The Time of Day editor config has this:

 

image.png.0209a27da407a0d22209c44edd018c7b.png

 

This seems to determine when an override is triggered. However, though it says "Player/Camera", I suspect it actually means "Camera". Certainly, if I drag my Player game object into that setting and hit run, I get errors that suggest the component was very much expecting a camera:

 

Adding component failed. Add required component of type 'AudioListener' or 'AudioSource' to the game object 'vBasicController_VBOT_LOD' first.
UnityEngine.GameObject:AddComponent<UnityEngine.AudioReverbFilter> ()
ProceduralWorlds.HDRPTOD.InteriorControllerManagerData:SetupAudioReverb (UnityEngine.Transform) (at Assets/Procedural Worlds/HDRP Time Of Day/Scripts/HDRPTimeOfDayInteriorController.cs:150)
ProceduralWorlds.HDRPTOD.HDRPTimeOfDay:SetupInteriorSystems () (at Assets/Procedural Worlds/HDRP Time Of Day/Scripts/HDRPTimeOfDay.cs:1968)
ProceduralWorlds.HDRPTOD.HDRPTimeOfDay:OnEnable () (at Assets/Procedural Worlds/HDRP Time Of Day/Scripts/HDRPTimeOfDay.cs:788)

NullReferenceException: Object reference not set to an instance of an object
ProceduralWorlds.HDRPTOD.InteriorControllerManagerData.SetupAudioReverb (UnityEngine.Transform camera) (at Assets/Procedural Worlds/HDRP Time Of Day/Scripts/HDRPTimeOfDayInteriorController.cs:153)
ProceduralWorlds.HDRPTOD.HDRPTimeOfDay.SetupInteriorSystems () (at Assets/Procedural Worlds/HDRP Time Of Day/Scripts/HDRPTimeOfDay.cs:1968)
ProceduralWorlds.HDRPTOD.HDRPTimeOfDay.OnEnable () (at Assets/Procedural Worlds/HDRP Time Of Day/Scripts/HDRPTimeOfDay.cs:788)

 

Would it make sense to have two settings here:

 

  1. Scene / Main Camera - used for camera operations.
  2. Player / Tracked Game Object - used for override and other settings that look for a "current transform"

 

Or am I barking up completely the wrong tree?! 😉

 

Thanks for your thoughts!

Link to comment
Share on other sites

It defaults to a camera position as for some games like third person you don't want the volume to take affect until the camera in within the space as the character would enter the space before the camera and that creates weird effects. Of course you can change the target to be the character transform at anytime. But everyone has different preferences.

Since the override volume system uses bounds contains and not on trigger enter, it makes it hard to test based on a layer or tag. We could however add a override transform in the HDRP time of day manager to specify what is used for volume overrides and what will be checked against in the bounds contains for applying the volume overrides.

Link to comment
Share on other sites

That's awesome, thanks Josh!

 

I know I ask this every time (and I suspect I know the answer!), but is there ANY indication of when the new version will be released?

 

Thanks again!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...