How to make trace hit specific parts of an object?
I've been trying to a create a pulling/pushing system in my game. I've have been using traces to make sure the player is hitting the object then using a Actor local offset to move the object. My problem is that the player can hit the trace from any direction. Is it possible for the trace to hit a specific position of that object to move it? Like a trigger or a specific face?
Many Thanks Mrfantasticghost
asked Jul 27 '14 at 01:44 PM in Blueprint Scripting
Here is one way you might do it.
On your break hit result, you have hit location. Use that to reference against your pawn's vector. Calculate up the offset between the pawn's vector and all his parts that you want to react independently.
If a trace hits the pawn, you do the math to figure out where on the pawn it hit, and then call events accordingly.
You could do this to show a player being hit in the shoulder or leg, or perhaps you could use it to put spin on a pool ball.
answered Jul 27 '14 at 08:16 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here