Tuesday, April 13, 2021

FMP Week 28 - April 13th - Sound, Presentation and Animation Implementation

 FMP Week 28 - April 13th

Sound, Presentation & Animation Engine Implementation

William Marshall 


Intro

The animations that were being worked on last week have been ported into Unity, which allows me to demonstrate my models and some functionality!

Presentation


This is a breakdown of how my scene currently looks in Unity. It is broken up into three different scenes, which accommodate the Rotary, Haytham and Ranger respectively. Each of them have their own unique material selections - which I added to add some variety to my models. This is done by selecting the forward/back buttons, which will cycle between four different materials per model, which also loads their own thematic name for the material.

In order to demonstrate the animation work for this project, I assigned each animation to a specific button, which will play the designated animation and any sound effects alongside it. In the next sections, I will show how this is all set up technically.

Animation Implementations


As I mentioned last week, the animations for each Mech were created on a single timeline. When they were imported into Unity, I was able to slice up that timeline into separate animation clips, which saved a lot of time manually separating each clip in 3dsMax.

Splitting up each clip also allowed me to see if the animation looped and displayed properly, which was another advantage.


However, in order to get the animations to work properly, I had to use the Animation Controller system to determine which animation was being played. In the screenshot above, you can see how I set up this system. Each animation state transitions to the other states with true/false statements, meaning that regardless of which animation is being played, any other button selection will allow the new animation to play. 

Booleans were used for the true/false statements, with simple transitions like 'Missile', 'Walking', 'Drop' and 'DualFiring' used as designations so I knew exactly which state they related to.


With the animation states set up properly, it required some scripting to trigger when the transitions were being called. For example, if 'Missile' was being called, it would turn all the other booleans into a False state, which would mean that the Missile animation state would be called - resulting in the Mech playing the Missile Firing animation. 

This script was then applied to the buttons in the scene, as well as the models of the Mechs themselves.

Sounds & Setup

In order to sync up the sounds with the animations that were being played, some scripting and sound design was required. I gathered some basic sounds from Freesound.org, which hosts copyright-free sounds and music clips that are created by individual artists, as long as they are credited. Using Audacity, I was able to improve and re-make the sounds I gathered to suit my own purposes. They were then exported as .WAV's into Unity.


In the script that determined the animation states from earlier, I was able to insert some references to Audioclips that would be called when certain conditions were met. For example, if the 'RotarySpinUp' event was called, it would identify the SpinUp soundclip and play an instance of that particular sound.


Using the events that were called in the script mentioned above, I returned back to the animation window of the imported model. Below the animation frames is a section called 'Events', where I was able to insert references to the statements in the script, such as 'MinigunPew' when the Firing Animation was called. Additionally, I could place these events wherever I wanted on the timeline, which meant I could determine when the sound was played in the animation.


Finally, I inserted the sounds into the correct sections, so that these specific sound clips would play when their event was called using the script. 


This video shows a live demonstration of this in action!

Next Blog Post - 27th April

With all of my sounds and animations being set up properly in engine, I just need to complete all of the required sounds and particles, as well as polish up the project to make it look as nice as possible.

For the next blog post, I will be demonstrating these things:
  • Animation Improvements (Based on feedback)
  • Rendering
  • Polishing


No comments:

Post a Comment

FMP Week 32 - May 15th - Final Unity Build, Animations, Portfolio Setup and Reflection

      FMP Week 32 - May 15th Final Presentation, Final Unity Build & Animations, Project Reflection William Marshall   Intro The project...