Dynamically change character MaxForwardSpeed

Hello.
I have FirstPersonCharacter. I can dynamically chanange it’s speed via C# script. Influenced should be different character speed on different terrain surfaces.
I tried all sorts of things yet but not work correctly. Anybody to help me please?
Thanks

i will not write the code but what you need to do (if this is with terrains), is to find the texture that is currently applied under the player feet, (have a look at unity Terrain scripting , Unity - Scripting API: TerrainData) after than apply speed based on texture on terrain

if you are using other meshes for floors, then just tag a floor as a type and when player collider touches that type of tagged floor, switch the speeds.

You could do all that, or just use Phsysic Materials and put them in the colliders of the Terrain.
In a Physic Material, you can define the amount of friction applied to object sliding across the collider :slight_smile:

http://unity3d.com/learn/tutorials/modules/beginner/physics/physic-materials

Of course, if the situation is more complex, you can use the above answers instead :wink: