How do you make a damage marker for an fps?
I've not implemented a feature like this before, but this is how I would approach it.
Set up a widget, if you haven't already. In the middle of that widget, you can add an image or material. When your character gets shot, keep a record of the direction they were shot from as a rotation, probably in world space. You can then add some logic into the widget graph to take that rotation and convert it into an angle. Something like finding the difference between your characters rotation and the rotation of the shot, where if you are facing directly towards the shot it returns a 0 angle and if you are facing away, it returns 180. Makes sense.
You can then use that angle to rotate the image you placed earlier. Widget components have render transform information which includes an axis of rotation. If your logic is correct, you can rotate an image (most likely of an arrow) to point in the direction your character was shot from.
I know there are more complex ways this can be done to allow for multiple arrows, for example, but hopefully this can at least get you started. Hope this helps.
answered May 19 '19 at 01:28 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here