Journal Entry 3: Fixed Movement and Meteors


Date: 12. 9. 2021

My first task today was fixing some issues with the player movement. The player got frequently stuck even on level ground and jumping only worked sporadically. My suspicion was that the first issue was caused by the tilemap colliders being several squares instead of one single rectangle. I fixed this by using CompositeCollider and merging all of the squares together. The issue of jumping was pretty mundane, turns out I used GetButtonDown, which only reports button press event on the exact frame it happened. I changed this to GetButton and also simplified the ground detection with ContactFilter.

Creating meteors was simple, although it took me a while. First I sliced another spritesheet. Then I created sample meteor object with SpriteRenderer and PolygonCollider I set to trigger mode. I had some issues with the meteor not detecting collisions with the tilemap collider, turns out the tilemap rigidbody should have been set to kinematic instead of static. Once I had this figured out I proceeded with adding a trail, writing some code for meteor movement and spawning. For testing purposes I made meteors spawn when the M key is pressed.

Files

Day2Build.zip 22 MB
Sep 12, 2021

Get Don't Be Afraid To Fall

Leave a comment

Log in with itch.io to leave a comment.