So, I want to make it so when my character touches a hazard like spikes, they’ll get thrown the OPPOSITE direction they were headed towards them.
This is my current blueprint.
How would I check for this?
By the way, this is a sidescroller, so I’d have to check the Y velocity.
Help is appreciated.
duderseb
(duderseb)
October 24, 2018, 6:55pm
2
Have you tried the Add Radial Impulse node? You can feed it the HitLocation of your EventHit.
Engylizium
(Engylizium)
October 24, 2018, 7:22pm
3
I think you could check player velocity by GetVelocity and on collision use VInterp To to set new actor location
SABERiize
(Steven Jacobs)
October 24, 2018, 7:43pm
4
This is easy. Take your hit normal, (the face direction of the surface hit) and multiply that by a negative float value that feeds into add impulse node, and apply that impulse to your character.
Opps, forgot to connect it to the damage, but it doesn’t make a difference. It’s still only throwing the character from one direction.
Gahhhhh, I attached it to Hit Location by mistake, works perfectly now. Thanks!
SABERiize
(Steven Jacobs)
October 25, 2018, 5:33pm
8
No problem, you are welcom.