Worker Blocks



This week i worked on the worker blocks. My main concern while working with these blocks was them clipping on their corners, going into the walls and floors. The worker blocks were set up to bounce off of surfaces based on which side of the block hit a surface. Becuase these blocks are constantly rotating this presented a challenge to figure out which side was bouncing off of a surface while rotating. 



At first i had tried to go with a raycast solution to figure out which side was up while rotating. after hours of researching and playing around with the raycasts i was unable to properly get a raycast to only hit the floor coliders without reporting a ton of other coliders and objects. Even with the correct layers selected i was unable to get anything to work correctly. 


Instead of a raycast i decided to calculate which side was up based on the rotation of the block. While this looks a bit bulkier in code it works just the same and was able to get the results i was looking for. 

Leave a comment

Log in with itch.io to leave a comment.