Seeking help or Tutorials for Raycast/movement script.

Hey guys!

I’m developing a game where enemies, much like Mario, are supposed to walk right and left.
The part where I’m stuck at is the raycast or collision detection that makes the enemies… well… go the other way.

So what I’m asking is, is there an easy tutorial or an easy way to use for example
rigidbody.addforce and then on collision with wall or other collider turn the addforce.direction to the opposite?

Btw, this game is 2D and I’m coding in C#.

Thanks for taking the time to read this, looking forward to help in anyway :slight_smile:

Maybe this can help…
www.unity3student.com