#9 | 2023-06-26 | Fixing Collision Bug #1
Hello!
From the testing and the feedback I received, I observed a collision bug.
When the player collides with an angled tile, they get stuck and can only be unstuck my pressing the jump key. The player is supposed to move up the angled tile but this prevents it.
Searching for a solution took time, but nothing I found fit the bug nor worked to fix it. I had to come up with my own solution. Initially, I thought creating a prefab in the shape of the tile with a modified collider would work. The first iteration didn't work, but the second did.
Because there isn't a built in triangle collider, I made my own using the polygon collider. Quick and simple, but it gets the job done.
Using this prefab, I observed that the player could move halfway up the object but would fall down. I figured that if I increased the player's speed when they collide with this object they would be able to make it up. I created a script to facilitate this.
When the player is colliding with this object, I multiplied the "moveSpeed" value of all player controllers buy a set value, being changed as needed.
Since the player's speed was increased when colliding with this object, I had to reset the speed when the player stopped colliding with it. When the player stops colliding with this object, the "moveSpeed" value of all player controllers is divided by a set value, also changed as needed.
This fix was simple, but a little janky. I'll have to come back to this and make it smoother, but for now it will work.
Next up, improving the game's graphics to better fit the theme of a death factory.
Thanks for reading and stay tuned for the next log!
Get Factory of the Damned
Factory of the Damned
2D Side-Scrolling Platformer!
Status | In development |
Author | Ice Diamond Studio |
Genre | Platformer |
Tags | 2D, Puzzle-Platformer |
More posts
- #27 | 2024-01-20 | Project EndJan 21, 2024
- #26 | 2023-09-24 | Beta v1Sep 24, 2023
- #25 | 2023-09-16 | New TrapsSep 17, 2023
- #24 | 2023-09-03 | Scaling Down DevelopmentSep 04, 2023
- #23 | 2023-08-25 | Development RoadmapAug 25, 2023
- #22 | 2023-08-24 | Alpha v2 ReleaseAug 24, 2023
- #21 | 2023-08-16 | Major Code OverhaulAug 16, 2023
- #20 | 2023-08-13 | PSAAug 14, 2023
- #19 | 2023-08-01 | Major Code OverhaulAug 01, 2023
- #18 | 2023-07-31 | Major Code OverhaulAug 01, 2023
Leave a comment
Log in with itch.io to leave a comment.