Adding animations and finishing the game
Continuing with finishing the game, I managed to fix the problem with the lighting changing between scenes, by finding on a forum the solution which was to go to the lighting settings and apply the lighting for the scene? This fixed the problem of it getting dark in the second scene. Loading scene additively causes change in lighting - Unity Forum
I also watched this video on how to implement animations into unity however I had a problem where the animations that Allaster had sent me said that they had no animation data when I clicked on the animation tab within them. Allaster resent the animations and this fixed the problem.
https://youtu.be/hlO0XlqZFBo
In this video, they show how the first thing to do is import the animation/character and if they are facing the wrong way you need to bake the axis conversion(in the model section), in my case the animations were turning out the wrong way (because I hadn't done this for all the animations). Next, you need to create an avatar definition from the model in the rig section which can then be assigned to the animation controller. You then have to go through the animations and set the loop time so it is ticked. And since the animations I received were separate I had to add them to the model I was using. I also had to add the animations to the animator controller, for the rhythm scene I had them set to loop (they could have been set up to play with key inputs however we just wanted the animation to work at this stage and we thought that it looked good just looping. I also adjusted the exit time for one of the animations so that there was more time between them, because the transition seemed a bit too quick.
This is the video I took after I finally after lots of trial and error go the animations to work however some of the animations were the wrong way because I hadn't baked the models as I mentioned. This looked quite funny but was a good breakthrough so I shared this video with my teammates. This video is when I got them the right way and removed the walking animation(since that was for the collection stage)
For the collection stage, I implemented the speed conditions so that the animation would change to an idle one if the speed was less than 0.01 I had to adjust the script where it set the speed since it was giving positive and negative numbers I believe I used Mathf.Abs which makes negative numbers positive.
I also tried some different scripts for the rotation of the character, some didn;'t really work well as you see in this video, the character spins:
I ended up using a part of the script from Ketra Games - https://youtu.be/2_Hn5ZsUIXM
However, I had to adjust this by making one of the uses of rb.velocity into -rb.velocity since the character was rotating to face the wrong way and this couldn't be fixed with the model. I would have liked to have figured out this script on my own but it was a bit complicated so I just used this adapted version.
One of the last few things I had to do was add all the arrow prefabs and assign them to the array in the managing script. This took quite a while but it was nice to be able to pick the order of the arrows, Laura had worked out the correct timings for the beats but they had got lost so to make it easier we just kept with the arrows being instantiated every second. I added some double arrow prefabs in places where I thought they matched the music but other than that I tried to keep them quite random. In hindsight, there was probably some way to script the arrows that would be spawned but this was the way that I found to make this work and I didn't want to overcomplicate it.
After making the uncompressed build we had a final hurdle of the build resolution settings not being right, this meant that the aspect ratios were off on all screens and I don't believe this was connected to the previous aspect ratio problem we had. This was just a simple fix and then I sent the link to the game to my teammates so that they could try it and see if there were any problems before we submitted it.
This video shows the final game: https://youtu.be/IWsTeeMUJCg
Comments
Post a Comment