Assignment 8: Whale swimming and dying using Playmaker

Assignment 8: Whale swimming and dying using Playmaker


 

I created a fantasy-like scene which has a whale in space in this project. I tried to trigger the whale to move using another object: the cube. When you get close to the cube, the whale swims; when you leave the cube, the whale dies. You can hear two different sounds when entering and exiting the collider.

I definitely encountered a lot of problems when doing this project, especially in terms of the audio. We did not learn how to trigger audio in class, so I searched across Youtube to find the tutorial, and those I found all had something to do with java scripts. This is a challenge for me for sure, since I have zero experience in computer science. I followed tons of different videos, and spared every effort trying to understand the script. Fortunately, I figured it out in the end.

The tutorial I found particularly helpful is: https://www.youtube.com/watch?v=LfXc0a5eUdg. This video contains the entire java script that can help you to trigger a sound when using the collider. The key is, the version of Monodevelop in our lab is not the same with those in the Youtube tutorials. Make sure you save the java script by clicking the close button in the application, so the script is saved to your Unity. I followed the rest of the video, embedded two audio scripts under audio sources to trigger both "entering" and "exiting" sound. You can see that in the right column in the below video.

Here's my unity scene.

No related post

COMMENTS

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.