Alternatives to LineTrace?
I am trying to implement an item pickup system when using a fixed camera. I have it working fine with the code below, but I am doing a linetrace to detect if an item is in front of the player pawn and that means getting the player to look down to pickup items on the floor and up if its above the ground which is impractical with the camera. What I would like to do is do a shapetrace (like a cone) or multiple linetraces to check multiple angles for a collectible item at multiple y values. I was hoping someone might have some advice about a good way too achieve this?
asked Jan 27 '16 at 07:23 PM in C++ Programming
As many others have suggested perform a Multi-Sphere Trace which will get all items within a radius of the sphere. This is pretty fast performance wise. If you have multiple items that could theoretically be within the bounds and you want to only pickup the closest one you are facing you and first determine if your character is looking in the same direction as the item. There are a few methods to do this using line traces, sweeps, or even the Dot Product to determine which item the character is "most" looking at.
answered Jan 28 '16 at 01:29 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here