fredag 10 mars 2017

Raycast check

We added a raycast check from the projected ball to fix a bug that made the glass fall even if the ball didn't hit any glass.

This happened because we used the position from were the ball entered the box trigger collider and called a overlaps sphere from that position. So if the ball entered at a position that didn't have any glass it would still call the overlaps sphere which resulted in glass around from where the ball would pass through would drop. 

This is now fixed with using raycasting from the ball when entering the trigger collider. If the raycast doesn't register a hit with a shard object the program won't call the overlaps sphere and the glass won't drop. 

Inga kommentarer:

Skicka en kommentar