I have a rigid body character in my game and I don’t want it to slow down when touching walls, but I do want ground friction for him to slow down when grounded.
What’s the best way to go about this (and I do not manual want to set the friction value of every wall and floor in the game)
Fast and tricky solution: make the walls “ice” (without any friction).
But then you slide when you are on the ground
Then separate the ground from the walls. It’s not rocket science.
Did you not read the OP?
I dont want to manually set everything as either wall are floor, there must a code way of doing this
You don’t need to set the friction for every wall, you just make a Physics Material and apply it to the relevant objects. If you want a wall to be both a wall AND a floor then you just have to work out if your character has collided at the sides or at the bottom, which is fairly trivial. Once you know that you can switch out the Physics Materials from Wall to Floor (no friction to friction) through a script.
This is the way the physics work in unity. If you try and work outside of the physics system instead of with it, you’ll get headaches.