Journal Entry 6: Walls and Automatic Meteor Spawning


Date: 15. 9. 2021

My first task today was supposed to be creating walls but I decided to put some more time into tweaking the damage system. Most importantly I added the starting health query and on damage taken callback.

I had the basic idea of wall done fairly quickly but I ran into some trouble. Interaction between walls and the player was very weird. The player could levitate when bumping into to wall and touching walls in flight would randomly boost the player. Sometimes the boost was so big that once the player landed back on the platform it fell trough or got stuck inside.

Once I fixed the fixed the first problem I realized both of the problems were the same. The ground detection system was set up to indicate ground when touching ground or wall tiles, which is not entirely the intended behavior. Touching the walls from bottom was enabling the player to continuously jump and the boosting was just repeated jumping. Once I figured this out fixing it was quite trivial, I just constrained the angles that register the ground contact.

Regarding walls I also added textures indicating damage the wall has received and implemented spawning walls when pressing W including snapping them to the grid. I also used the composite collider, just like with terrain.

Once I had walls figured out  I implemented the automatic meteor spawning.  I had this done fairly quickly as I was able to reuse some code from earlier days. However I ran into some problems with the walls again. They have suddenly become invincible. After a lengthy debugging session I realized, that the entire problem was missing rigidbody on the walls prefab. I got rid of this component once I decided to use composite collider. Once I added it back everything worked like before.

Files

Day5Build.zip 22 MB
Sep 15, 2021

Get Don't Be Afraid To Fall

Leave a comment

Log in with itch.io to leave a comment.