Problems with Colliders on Items


Author: Zoleda Davila

Posted on 2/1/2024

One of the key features we wanted in our game was to give the player the ability to equipped items in their hand that they had in their inventory. A reference inventory system from a video game I was using to accomplish this was the inventory from Minecraft. When you move the item into the bar at the bottom, you are able to equip it in your hand. The problem that I was having trying to do this in our inventory system is that the collider we were using to detect the item on the ground would interfere with the collider on the player when it attached as a child actor component, sending the player flying out of the level. This also caused problems with the members who were working on the weapons needed to defeat the enemies. This was because I originally worked on the weapons and items first, so the original collider that I had put there was causing trouble with their implementations.


The first thing I did was take my collider off the actual in game items, so the other members could do their work and I created a test item to experiment and test my work. We believed that this would be easier for all of us, because their work had a lot more involvment in those blueprints while mine was only dealing with the collider portion. In order to solve my issue, I put the collider on the test item blueprint. Then I created a function that checks if the item is attached to the player as a child actor component. If It is attached then the collision settings on the collider will be turned off. If not, then the collider will be turned on. Then, we use the original equipped function created to attatch it to the player. When testing this solution on the test item, it was a success. In order for all the items to have the same collider and functionality, I tranfered my work onto the base item blueprint that all the items would inherit from.

Leave a comment

Log in with itch.io to leave a comment.