Sequence to change scenes

Announcements, support questions, and discussion for the Dialogue System.
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Sequence to change scenes

Post by Arctichorse9 »

Is it possible to change the trigger to load the sequence to change scenes from OnUse to On Collision Enter or On Trigger Enter?

I note this message in Demo Scene 1. I tried to change the method from On Use to On Trigger Enter or On Collision enter to change to Demo Scene 2 but it didn't work. Any help is appreciated. I added a rigidbidy to the door. Checked is kinematic. Checked is trigger on the collider.

"When this Usable's Dialogue System Trigger gets the message OnUse from the Player's Selector, it runs a LoadLevel() sequencer command to change scenes to DemoScene2."
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequence to change scenes

Post by Tony Li »

Hi,

I believe you're also using Grid Controller. If so, use Grid Controller's Scene Portal, like the "Scene Portal" GameObject in the Grid Controller + Save System example scene.

Otherwise, using a Dialogue System Trigger set to OnTriggerEnter or OnCollisionEnter is fine. Make sure the object with the collider (e.g., the Player / Grid Controller) is tagged Player, and click the Dialogue System Trigger's "Add 'Player' Tag" button. Set it up like the triggers in DS's DemoScene1 and DemoScene2 to play the LoadLevel() sequencer command.
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Sequence to change scenes

Post by Arctichorse9 »

I did all that and it still doesn't work. I can use the Scene Portal but am making a puzzle and would like to use this for the puzzle. Also if this should work, trying to understand why it doesn't. Thanks. I'm using the Demo Scenes to test it.
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequence to change scenes

Post by Tony Li »

Hi,

Here's an example scene:

GC_LoadLevelExample_2025-05-09.unitypackage

It's the Save System Example scene with two changes:

1. I moved the Scene Portal GameObject to the right.

2. A bit further along beyond the Scene Portal GameObject, I added a GameObject with a Dialogue System Trigger set to OnTriggerEnter. It runs a LoadLevel() sequencer command to load the player at the specified spawnpoint.

If this doesn't help, can you send a reproduction project to tony (at) pixelcrushers.com?
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Sequence to change scenes

Post by Arctichorse9 »

You are wonderful. I will try it in a little bit. Not at computer. Thank you.
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Sequence to change scenes

Post by Arctichorse9 »

That works perfectly. Thanks very much.

BUT----I'm trying to get the Demo Scene in the Dialogue System itself to work using On Collision Enter or on Trigger Enter to work which does not use the Grid Controller. The player in the scene with Private Hart doesn't move to the second scene if I change the method of triggering the Load Level Sequence from On Use to On Collision Enter or on Trigger Enter.

Trying to understand the Dialogue System set up more thoroughly. And why that seems to work differently. Thanks.
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequence to change scenes

Post by Tony Li »

Hi,

Here's a version of DemoScene1 that uses OnTriggerEnter:

DS_DemoScene1_OnTriggerEnterLoadLevel.unitypackage

I made these changes:

1. Deactivated "Info: Door LoadLevel". (Not technically necessary; just did it.)

2. On "Door to DemoScene2":
  • Removed the Usable component.
  • Ticked the Box Collider's Is Trigger checkbox and set Size > Z to 2 to make it bigger.
  • Added a Rigidbody. UNticked Use Gravity (doesn't matter though) and ticked Is Kinematic.
Make sure DemoScene2 is in your project's build settings.

If it doesn't work, check the Console window for errors or warnings.
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Sequence to change scenes

Post by Arctichorse9 »

That works perfectly!!!!!! You have taught me a lot.

Thank you so much. My collider may have been too small. Ironing hands. : )
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequence to change scenes

Post by Tony Li »

Glad to help!
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Sequence to change scenes

Post by Arctichorse9 »

I finally got around to leaving Dialogue System a review in the Unity Asset Store---under my more common name of Catacomber. : ) This is truly one of the best assets I've used from the Asset Store and really appreciate all your help.
Post Reply