Hi, I have a projectile and a Pawn. When projectile hits the Pawn an impulse is being applied with some ridiculous value. I want to fine tune it but can’t understand how it is actually work.
DamageType with 0 values are specified in ApplyDamage event.
Both projectile and a Pawn set to disable damage on hit.
I think the case might be is that projectile has Simulate Physics disabled and it use ProjectileMovement to move, so very powerful impulse is applied on hit. If it is so what can I do in this situtation? Implementing phys for projectile is not the best way to do it I guess… Is there a way to disable the impulse so I can apply it manually on hit?
Hey there @panthernet! Generally the impulse that comes from projectiles set up with the Projectile movement component actually has to be applied in the projectile’s BP like the FPS template example here.
@SupportiveEntity The point is I don’t have any AddImpulse or AddForce calls in BPs still the damaged object flies too much away on hit. I use only ApplyDamage here.
The projectile has only StaticMesh and ProjectileMovement components.
This behavior applies to evey object with simulated physics I hit with the projectile
So if I am understanding correctly, you still have physics enabled for your pawn, just not your projectile? For your simulated objects themselves, are you also using static meshes? If so, have you tried adjusting the mass of your pawns? Or messed with the linear and angular dampening?
Thanks, you have understood correctly. I use static meshes with mass but when it comes to projectile → pawn collision the mass don’t work.
Dampening looks good, but I have two concerns:
I want to control how much impluse different projectiles provide
I’m not sure how it will impact the future AI based physics moivement I want to implement.
Ideally it would be nice to have something like an BeginOverlap event with the ability to get Hit location. Or somehow disable impulse applied on hit from the projectiles.
That should not apply any force. What does your projectile’s blueprint look like? That will most likely be where the impulse is being applied. If that is the case, you want to directly affect the multiplier applied there. The trick would be getting the damage type BEFORE the pulse is applied (which I have not tried to do here because we are figuring out where your force is coming from). Here is an example of the format you might use while using interfaces:
Reading the forums I suspect this is the problem when kinetic mesh (phys sim off) hits physical object (phys sim on) and creating huge impulse on hit. I haven’t found if there’s a way to control it. There’re a lot of topics without a single solution besides the dampening which woudn’t fit here.
Ahhh, does the object or character have this checked on?
I didn’t think about it but there is an automatic impulse on damage system embedded to character maybe even pawns’ classes’ Skeletal Meshes or their Collision capsule. I always handle my impulses manually so I seem to have totally blanked on that.
Thanks, I’ve come up with the complete physics implementation for projectiles based on manual impulses with phys simulation turned on. Now it work as intended and quiet nicely scales with objects mass.