I need a line trace to go from the enemy towards the player, but end at a distance from the enemy. The reason is that I want to check if the player is within close combat range. I guess that the trick is to do some sort of math equation to get the end slot of the line trace to act in this way, but my math skills are weak - I can’t figure it out.
Has anyone done something like this or have an idea of how to do it?
Both those ideas would work - but would I not lose the ability to make sure that there was not wall or object between the player and the character? I want to make sure that the enemy don’t punch me through thin walls/ each other and so on.
Well then a line trace would be “perfect”? just do a line trace from the enemies BP, start at its actor location then get the actor forward vector and add as many units as you want the trace to be.
Edit: This is from content examples -> physics(map) which shows a line trace that starts at a actor location and ends at the length of the “Interaction Distance” float.