Jump to content

Stuck In UE4 Physics Hell

So I'm trying to get my AI_character to knock back when hit. I've spent all morning on this and got nowhere. I'm suspicious of the spazzing.

 

Here's the project. Halp plz.

 

https://drive.google.com/drive/folders/1rFvmD6N6YI0VpUKdfR1X0hbJfYe69ket

 

 

CPU: Core i9 12900K || CPU COOLER : Corsair H100i Pro XT || MOBO : ASUS Prime Z690 PLUS D4 || GPU: PowerColor RX 6800XT Red Dragon || RAM: 4x8GB Corsair Vengeance (3200) || SSDs: Samsung 970 Evo 250GB (Boot), Crucial P2 1TB, Crucial MX500 1TB (x2), Samsung 850 EVO 1TB || PSU: Corsair RM850 || CASE: Fractal Design Meshify C Mini || MONITOR: Acer Predator X34A (1440p 100hz), HP 27yh (1080p 60hz) || KEYBOARD: GameSir GK300 || MOUSE: Logitech G502 Hero || AUDIO: Bose QC35 II || CASE FANS : 2x Corsair ML140, 1x BeQuiet SilentWings 3 120 ||

 

LAPTOP: Dell XPS 15 7590

TABLET: iPad Pro

PHONE: Galaxy S9

She/they 

Link to comment
Share on other sites

Link to post
Share on other sites

knock back means first calculating the force then figure out the acceleration then apply the acceleration to figure out the velocity then using the velocity to figure out the position of the knockback object. You also need to factor in impulse and such if you want the game to be more realistic. I suggest you just google up the physics equations, like most science illiterate programers do... ahem

Anyways, coding it shouldn't be too much a hassle once the math and physics part are figure out. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

You could use an animation & have it end where you want the character relocated to. 

You could also just use a standard “move distance of ____ units” 

 

Finally i don’t know if Unreal has this but Unity has an “add force” command. If you’re already using this with the correct direvtion applied, try making the force unreasonably powerful. Always double, half or factor of 10 (up or down) your variables when unsure of what’s happening or not happening. 

 

I don’t know the Unreal API. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×