Making player slower on different terrain

How could make a players walkspeed slower/faster when they are walking on different types of terrain? (snow, grass, dirt, etc.)

If you find a way to do this please let me know how I should do it!

Thank you for reading.

You could do this via raycasting and values.

With this, you’ll have to cast a ray below the player every 0.5 seconds or so (so it doesn’t cut out performance) and then check the part the players on. If the player’s on, for example, snow, you’ll then change their walkspeed to something like 10.

1 Like

I saw a topic similair to this before, try using search.

But I saw something about a function that can see what terrain a user is on so maybe try search the wiki

You could either get the material by raycasting down or by using humanoid.FloorMaterial then just change the players walkspeed.

Hey, you really shouldn’t re-post a topic that’s already been posted and solved before.