Item Pickups
Author: Xavier Williams Problem: For the items in our game, we decided to have them be able to be picked up and dropped. The problem I had when implementing this was finding a good way to give the item to the right player. The way I originally tried implementing this feature worked, but it would have led to a problem with items picked up by one player going to another player. This is because it would look for the player controller component in the first index to decide what player was interacting with the item. This works when there is only one player, however once there are multiple, only the first player would be able to pick up items. Solution: To solve this problem, I changed the way picking up items works. Instead of checking for an interactable object in a straight line and using the player controller in the first index, all the items will use collision detection to detect when a player is standing over the item. This allows the game t...