Forum rules - please read before posting.

Camera Switch Triggers in 3D mode not working

edited April 2017 in Technical Q&A
Hi,

I have been right through all the forum posts regarding this and confirmed I seem to be doing everything right.

I am following the 3D tutorial video (the evil lair) and it was going fantastic.

I got to the point of creating the second Navcam, set the trigger to switch the camera but when my character collides with the trigger nothing happens.

I have done triggers before in the 2.5d, so I am aware it needs to have a collider and rigid body etc, and I am following the video tutorial - so we know my EL_tinbot has the rigid body and collider  - and the fact my toon does not fall through the navmesh would also indicate that my players collider is working correctly.

If selecting the Navcam2 while the scene is playing, I can see that yes it tracks the player once the trigger is passed by the player - but the Navcam1 is not switching to Navcam2 in the main game window.

As I said I am following the tutorial to the letter, and I have not missed any steps - but for the life of me cannot figure out why the camera view will not switch to the second camera.

Comments

  • edited April 2017
    Welcome to the community, @Geoff99.  I apologise for your trouble.

    Everything that you've described sounds right - are any relevant warning messages appearing in the Console?

    The first thing to do will be to determine the source of the issue, whether it be your player, the ActionList, or the camera system.

    Try temporarily disabling your player prefab, and dropping the 3D Demo's Player character, Tin Pot, into the scene and run it.  You can find him in Assets/AdventureCreator/Demo/Resources.  If it then works, the issue will be with your player - in which case please post some images of the Inspector so that we can try to see what's wrong.  Camera-switching via a Trigger is also performed in the 3D Demo scene, so you may want to open that up to confirm it's working for you there.

    Otherwise, try running the Trigger manually - which you can do by clicking "Run" in the Inspector at run-time.  You can get a confirmation that the Actions inside are running correctly by using the ActionList: Comment Action to output a message to the Console.

    Have you set up another Trigger to go back to the first camera?  Test disabling it if so - it may be that both are running at the same time.

    Otherwise, please post some images of the relvenant objects - as well as your AC and Unity version numbers.
  • edited April 2017
    Hi,
    Ok so I did as you suggested and we have some success thanks.

    So what I have done so far is just start with a blank scene and set it up with two cameras. I can get the trigger to work fine using Tinpot but not on any other characters I load (even tho they work in the game, ie the mecanim gilr or guy I can get imported and walking fine by using the tutorial) but they do not trigger the triggers for some reason, so they must be missing something.

    Otherwise, try running the Trigger manually - which you can do by
    clicking "Run" in the Inspector at run-time.  You can get a confirmation
    that the Actions inside are running correctly by using the ActionList: Comment Action to output a message to the Console.

    This works fine and performs the camera switch.

    I will go over the tinpot character and see what I am missing if I cannot figure it out I will pop back, thanks.

    *edit
    Ok nothing seems to be out of the ordinary, I will post a picture of my character inspector.
    The character can walk around properly, everything exactly like Tinpot can do but he does not trigger any triggers, he is set as the player as per the tutorial - and as I said everything else working fine.

    Using Unity 5.51
    imageimage">image
    image

    image
  • Check the layer that your collider is on - it must be set to Player, and should be on the root gameobject.
  • edited April 2017
    Aha you're a legend.. it was just the Tag I was forgetting.. Thank you, works like a charm now!

    Have to say, this is probably the best asset I have ever bought from the store, thanks for your effort.

    *Edit
    Also when you said you should disable the other trigger, is it unwise to run two triggers next two eachother with the camera switch? I just did that from following the 2.5d tutorial, but applied it in the 3D mode.. was that a bad thing?

  • You're welcome.  That's fine so long as they're separated apart from one another - but a better way now is to add an additional AC_Trigger component to the same object and change its Trigger type to On Exit, and then have the Trigger itself span the whole second room.  Again see the Demo game, which does the same thing.
  • Ahh ok I gotcha thanks!!

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.