Scene Change On Trigger in Unity
My idea of changing scenes in the MV was inspired by this little video tutorial.
I have imagined that it would be a good way to jump from one scene to another via the trigger object. I gave it a thought and came up with the idea for the Roof scene first. Initially, I wanted my trigger to be an invisible plane placed just underneath the roof level. I changed it to a 3D cube which I resized and put between the user and the bench. I made it invisible (via un-ticking Mesh Renderer). In the Box Collider I had to tick the trigger option to make it work.
Next, it was time to add the C# script to the object – the one visible in the photo featuring this post.
Unfortunately, I couldn’t test it on my computer as, I am not sure why, but I can’t move around the scene in a play mode – I need to investigate that issue further. Suddenly I thought of another idea. I decided to have the trigger object animated and slowly moving towards the user – it is still invisible, so the user can’t see it. At the certain time of the experience (approx.1m35s so the action of the character matches the music), the user will touch or more likely is going to be touched by the trigger object and will land in the second scene.
In practice, the user sees the character getting up from the bench and walking towards the edge of the roof, but when he is just about to jump down, the scene changes to the next one.
A character called “Her” is a trigger object in the second scene. She is an animated character, with C# script added and required components adjusted. When she is touched by the user, the scene changes to the last, Space one. I added this character as I had decided to change slightly the storyline of my project. At first, I didn’t want to have any additional characters in the second scene, just the user and the man getting up after a theatrical fall. While working on the project, I decided to add a female character being potentially the one the man was in love with. I think it is a dramatic addition that matches the mood of the song I have created this MV for.