Reverse direction on colliding with a wall

I need my character to reverse his direction automatically as he collides with a wall. I have the character on always moving, so it shouldn’t be too hard? I have tried a few things, nothing seems to work. Any ideas?

Have a vector called Direction and set default value.
On the Add movement input, replace the world direction with the Direction variable.

When you hit the wall, you Set Direction to GetDirection → NegateVector!

Cheers :slight_smile:

Ok i’m sorry. I feel this is the solution, but I’m still learning, I have only used vector variable once. I would really appreciate a picture if possible. I will try to do this but feel i will fail xD. Also where would you put this blueprint? A blueprint for a wall? or in the character bp?

Yeah I’m going to need a picture if you can please :slight_smile: I get the “theory” of it just not sure how to apply it. I think I have all the nodes down.

Any help would be appreciated.

Really appreciated

bump bumpy

Could you explain the method you’re using to move your character?

Oh sorry about the late response, my email didnt notify me. Event Tick Flip flops between running forward and backwards when i hit a key, So I cant figure out how to be able to hit a wall that reverses from forward to backwards and if i hit a wall going backwards to forwards. sorta like a ping pong effect

If I understand your method correctly, your current setup should look something like this:

You flipflop between going back and forth depending on (in this example, H) your button press:

So if you’d like to reverse that direction upon hitting a wall, in the wall’s blueprint you’d have something like this: