Forum rules - please read before posting.

Trigger unreliable...

I have 2 triggers set up to switch from the main camera to a 2nd camera and back again, as per the video tutorial for a 3d game. The first trigger works fine, changing from main cam to 2nd cam no probs, but the trigger to go back to the main cam is picky as hell.. sometimes it works, and sometimes it doesn't.
  Because it does work when it wants to, I'm assuming(hoping) there is nothing wrong with my set up.  Anybody else have any ideas on this?
Using the new Unity 5.5.0f3 full release, personal edition.  Thanks.

Comments

  • I had a similar problem, but it turned out that I was wrong in my assumption on how I need the trigger to be set up. If you switch cameras (to a close up, and back to the wider shot) it is VERY important to make sure there is enough room inbetween those two triggers.
    If there isn't, what will happen is that you trigger 2 triggers at the same time, which will cause a lot of sadness. For example, triggering the switch to the camera, while the trigger to switch it back is still active. If you turn around now, the camera won't switch back, because it doesn't register your character entering the trigger (Trigger type: On Enter) because it has already entered beforehand. Causing your camera to not switch back.

    This COULD be the problem you are facing now. Can you maybe provide a screenshot on how thoe triggers are set up? Inspector-wise and in scene?
  • Welcome to the community, @Rooster.  Screenshots of your setup are definitely going to be necessary to properly help.  Are you following the 3D tutorial exactly, or using the principles covered in your own game?

    Since that tutorial was made, it's now possible to attach two Trigger scripts onto the same Trigger object - meaning you can have one "On Enter" trigger to switch to the 2nd camera, and another "On Exit" trigger to switch back to the original one when the player leaves.  This technique is used in the included 3D demo for the area under the stairs, if you'd like to see an example.
  • @ Suro, that is exactly what I think was happening here - I had the 2 triggers pretty close together.

    @ Chris, thanks for your welcome and reply - since I posted this I have found a way not to have to change cameras, but I will inevitably need to use triggers again, so I will take a look at your example demo.
    Thanks for both replies :)

    Cheers.
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.