Forum rules - please read before posting.

Version 1.84 - Unity 6.1- Multiple Triggers and Cameras in a scene

edited September 8 in Engine development

I have an question about using triggers and associated cameras multiple times in a single scene.

I did the 3D tutorial where you add two triggers, one on input and the other on exit to manage the 2 cameras of the scene.

There it was rather simple. But to be able to use several cameras in the same scene, especially a corridor, for example here I use 4 cameras which include the navcam1.

The player arrives from the top area. There I put a first trigger that corresponds to the Navcam1 which allows if we come back here to go back to the basic camera.

Then the player goes through a second trigger that allows you to switch to a second camera, the third trigger is identical to the second, to allow if you come back to the area to put back the camera 2 plane.

Finally, the fifth trigger corresponds to a third camera to change the angle again. As before, the sixth is identical to this one.

So if we go the other way, we find each plane in the same way.

I wanted to know if this was how to proceed for this kind of case or if there was a simpler way because when there are only two cameras in the scene it's simple, you put a single trigger with an enter and an exit but there it requires more manipulation especially in this kind of area.

And there is a strange thing, concerning the first trigger, if I go back and I get to the trigger1, it switches to the Main camera and not to the NavCamera while I checked the box return to last gameplay .
I can put choose the camera manually in the node but there it doesn't take it with the box checked if I go all the way around and go back to the beginning.

Comments

  • This sounds kind of similar to something I'm doing in my game, using many triggers to handle many camera transitions.

    I'm not using navcams, and instead just a simple GameCamera object.

    I only use "OnEnter" for the trigger, which does a "Camera Check" action to make sure the camera isn't already active, then if false, it triggers the actual "Camera Switch" action.

    Return to last gameplay usually works for me, but there are some use cases where I've had issues, so I always specify exactly which camera the trigger makes you go to.

  • An alternative approach to having two Triggers on the edges of each camera's border is to use a single Trigger for each camera that covers the entire region that the camera should be active for. A single "On Enter" trigger that switches to the intended Camera should then be enough.

    Are you hard-cutting your cameras, or is the motion intended to be smooth?

    If smooth, consider use of the "Array" camera type in the Scene Manager. This involves placing down "marker cameras" at key points around the scene, each with a corresponding Player position. As the Player then moves, the camera interpolates between the different positions.

    This camera type is used by the Sample 3D Scene template.

  • edited September 9

    Yes, okay, so like this

    Each shutter release covers its camera area. I had thought about it but I thought it was possible to do otherwise with enter/exit.

    My cameras change all of a sudden, there's no transition.

    So if there are two overlapping triggers, kind of like here on the capture with the first two triggers, it's always going to be the one where the player comes in that will do the camera toggle.

    Drewid your game looks interesting, is it a survival ?

  • edited September 9

    I retested quite a bit and sometimes when the character really stops right in the middle of 2 triggers and you click again to move the camera change doesn't happen.

    For example here if the player stops at the intersection between the 2 and we click again the change to camera 2 is not done, it remains stuck on the .

    So I think it's better to avoid overlapping triggers and to leave a gap between each one to avoid that, right ?

  • Are you using Unity 6.1 or have you upgraded to 6.2? Just asking because I had a bug when upgrading to 6.2 with triggers behaving similar to what you mentioned, and had to downgrade back to 6.1

    Yep, my game is Survival Horror - demo is out tomorrow! https://store.steampowered.com/app/3096450/Decaying_Salvage/

  • I'd avoid overlapping Triggers like that - it can cause confusion with Unity over which Trigger is the "main" one you want to take effect.

    Instead, separate them by a distance comparable with the Player's radius, so that they can only be inside one at a time.

  • edited 8:49AM

    Hi,

    I'm using version 6.1 for my tests at the moment. I'll move on to 6.2 to really work on the project.

    Yes I spaced out the triggers, it seems to work much better now.

    Your game looks really great. A ps1 generation style game Dino crisis and RE with modern graphics.
    Do you model everything yourself (environment, character)?

    For your character, do you use tank control type movements or are they modern controls? I wonder one thing, why didn't you go for Unreal ? Because for this kind of project, Unreal is really ideal.

    I went from Unreal, which I've been using for years, to Unity to make a mobile app because making well-optimized and small mobile apps is not the best thing with Unreal.

    But I would have preferred to stay on Unreal because there I have to adapt to Unity and I find that the UI creation part is not very pleasant compared to the widget in Unreal for UI.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.