stop player movement on collision

ok, so I’m making this game and i want the player to stop moving when he hits a non-terrain object whilst still being able to walk back.
im currently moving the player back a bit on collision but that gives a stuttery effect if you keep walking forward.

it’s a 3D FPS game written in C#.

i want the player to be able to move back whilst not being able to walk into the wall or go trough it.
I hope you guys can help me out a bit :wink:

Just put an invisible collider wall in the ghost places.

Add the collider that will stop him, then change it to a trigger on the collider components settings, this will allow the player to move through it it wasn’t there and not behave as normal collision.

Add a script to the player control - or add it to the player control - that will disable the forward moving input when the player walks into the trigger the function called from the trigger is ‘OnTriggerEnter’.

You need to elaborate on the question as there is not a lot of information are you using a character control or using a capsule collider or something different, how is the character moving using physics or your own movement control.