Author: James Clarke
Posted on 4/22/2023
Unity Project
Picking up items for the player worked well, but as the player moved around the items being grabbed would block the camera's view if the player moved forwards. The idea behind the pick up was intended to be able to grab an item and move it about using Linear Interpolation to constantly transition the item as the camera moved, so the item would slightly lag behind the camera's movement. However, that lead to some issues such as the item blocking the camera's view and at higher speeds the player would bump into the item and hinder player movement.
Due to the nature of my implementation of the player pickup mechanic, the LERP (Linear Interpolation) allowed the item being grabbed to have a smoother transition to a certain grab point as the camera was being moved. This in turn caused the item to move slower than the camera's transitioning. I thought about making the transition faster, but I had an earlier issue working with the implementation where the item would move quickly, but seemed to have a trail of it's previous position following behind the object which I found to be slightly dizzying. So my end goal for this implementation was to allow the affected item to be held without impeding on the player's view and mobility while having the affected item move along with the player. The best current solution that occurred to me at the time was to change the parent of the affected item to the grab point attached to the camera, then unparent when the item was being dropped. This way the affected item could move around with the camera without impeding on the player and would stay with the player as long as they are holding the item.
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.