Hi, I have a pvp game with many AI too, based on spell casting. I now want to add a radial force every-time a spell hits a target. I added a radial force to my explosion actor (which happens every time a spell hits a target). However if I enable ‘simulate physics’ to AI and my character (which I think is required for radial forces) the pawns act weird, they drop on the floor and stop behaving like they’re supposed to. Any advice? I’m also open to something other then radial force all I want to achieve is a knock back effect
Don’t enable physics on characters. Bipedal movement is simulated without using physics. Enabling physics will simply make them go full ragdoll and you’ll lose all movement input functionality.
CharacterMovementComponent provides its own AddForce/AddImpulse/AddRadialForce/AddRadialImpulse functions, which you can call to knock the character around without enabling physics.
The RadialForceComponent is supposed to handle the CharacterMovementComponent case though, but I’ve never used it so I don’t know if you need specific setup for it to work. Peek at its code to see if you are fulfilling all the conditions :
Some additional notes :
the “vel change” parameter is big deal, if true the impulse is multiplied by the Mass of the target component. It can make a big difference. If you omit that parameter and don’t see any movement it may just be that your impulse/force is not strong enough.
if target is on ground and you fire a horizontal or negative-Z impulse/force, chances are you won’t see any movement because the ground friction forces are HELLA STRONG. You might want to systematically bias your impulses towards a positive-Z in order to lift the character off ground.
Could you please explain it in blueprints?