So I have a first person player setup with arms and a gun as well as capsule collision for movement.
If an AI shoots at me how should I handle collision and damage.
Thanks in advance!
So I have a first person player setup with arms and a gun as well as capsule collision for movement.
If an AI shoots at me how should I handle collision and damage.
Thanks in advance!
Hey there @XenenEG1! Welcome to the community! From a high level perspective, you have two main branches of options, stemming from how you want to handle your bullets. If you’re using mostly rays for your shots or if you’re using physical projectiles. You can use your character movement collider as your damage body but if you go the trace route you may want a full player model to query for hits, but by no means is it required!
I’ve got a tutorial here to get you started with AI behavior trees and another to give you a bit of help with your blueprinting (in this example it uses projectiles but you can easily extend it to use traces instead).
Disclaimer: Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.
Seeing as you only have the arms your only option is to do collision on the capsule.
On hit → break result → If “hit component” is capsule → calc damage → apply damage.
If you add a full third person body you can then add physical materials to the phys asset collisions and do per appendage dmg…or go crazy and do bone look ups. Traces/projectiles need to ignore the capsule though. You’ll need a custom collision channel for the capsule (Pawn Capsule) and one for the projectile or Trace.
I personally do phys materials on the physics collision components.
Arm, Hand, Leg, Foot, Head, Neck, chest, Torso, Pelvis