Squash Animation fix
I fixed the problem that occurred whit my squash system that I talked about last week. I was not sure in the end of last week if I had fix it or not, but this time I feel pretty sure that it is fixed. The problem was the timing in between the player’s regular update and the squash systems update. The squash system is made of a coroutine that has its own update functionality. I think the problem started when I changed the players update loop to be a fixed update loop. That would make sense because the coroutines update no longer matched the players update. I looked in to coroutines a bit more this week and discovered that the coroutines have a yield command “WaitForFixedUpdate”. I tested to remove my earlier tries of fixing the code and instead implemented this yield command. Now the update loops match each other and I have yet not discover any problem. Everything works like a charm again.
Score PopUp
I made a little hud pop up message that displays the amount of score you got for certain things. For example if you would make a perfect landing after a jump this message would pop up and tell you what you did and how much score you got for it. It looked really nice and is a good feedback for the player.
Tire track
I started to code a script that will make a tire mark after the player. My prototype turned out good and I will continue whit it next week. Right now it creates a mesh in runtime from the player’s positions. Next week I will make sure that it creates correct UV coordinates. I may also create a custom shader, so that it will fade out the mesh depending on vertices colors or something like that, we will see next week.
Destructible environment
The level designers in our group wanted to have more dynamic things to work whit in the world to make it more interesting and living. So I made it possible for them to create destructible objects. What it does is basically just adding a rigidbody to the object when needed. I tried to make this so it would affect performances as little as possible. So all the colliders are first just triggers and when the player hit them they get active and turn in to normal colliders and add a rigidbody. They also add a force almost equal to the player’s current velocity. If one of the destructible object hits another destructible object that object also turns active. When the rigidbody of a destructible object is sleeping it turns the collider back to trigger and removes the rigidbody. I think this worked really great and it looks really cool in the game.
Tutorial
I have also worked whit creating the tutorial of our game this week. I made a script that shows a message and has options for pause the game when the message is showing. It also has options to unpause the game when I hit a button or as long as I hold down a button. I made a lot of more options so it would be able to be used for everything in the tutorial level and stuff that may be added later.
Wind shader
I made my own shader so that trees and plants would wave like they were affected by the wind. I have not worked much whit shaders before and it was a bit hard to figure out how I could have all the transparent functionality that our trees had before and at the same time moving the vertices. I could not find any good example of this on the internet. But after some time and different tries and approaches I managed to get it working. I think it looked really good in the game as long as you stand still. But our game is moving very fast and therefore you don’t notice that the trees are moving anyway. So my work was a little bit a waste of time, but it will still look nice in some situations.
Score menu changes
I changed one of the things you could get score of. Before you got more score the less you used the checkpoints in the game. But we decided to remove this category and instead add a category named bonuses. Now you instead get a bonus if you don’t use any checkpoint in a play through, you could also get bonuses for other things, for example if you been in the air for more than 4 seconds.
This change made so that I had to tweak the score menu a bit. As we wanted to show what bonuses you get when you get score bonuses.
|