Slide mechanic?

I’m currently working on a sandbox adventure game (like Super Mario 64) and I’ve run into an obstacle. I don’t know how to make a slope that makes you slide after you have been on it for a while. I’ve tried doing math using attachments but I’m horrible at math so it obviously didn’t turn out well. I already have the script detecting what surface your on, I just don’t know how to make the player, ya know, slide.

Thanks!

1 Like

How about you check this thing called MaxSlopeAngle; its in humanoid and it can probably help you out a bit

Like just check if the max slope angle is greater or equal to whatever and then add a body velocity to the player’s humanoid root part and set the velocity to the inverse of the humaoid root part cframe lookvector

MaxSlopeAngle

1 Like

The script can already identify the slope based off of its name.

Can I see an example, I’m kinda dumb.

I’m going to bump this post since I haven’t seen a good solution or example yet. Sorry. A lot of times body velocity is kinda glitchy, but thats probably because I’m not using them correctly.

Why don’t you make them sit down and play your own animation that you want since that is what people use to make slides.

I would do that but it is extremely unreliable, the player goes haywire and spins around.

That would probably be the only easy way to make a slide system for a slope. As well as platform stand.

Is there a way to make it more reliable? Since a lot of times the basic slide mechanic can fling players.

Probably but I can’t test it right now since I am on mobile.

1 Like

Instead of using max slope angle I would make a module something like:

function GetSurfaceAngle(normalVector)
    return math.acos(normalVector.Y)
end
local angle = GetSurfaceAngle(norm)
            return angle
if angle then
--velocity slide stuff

instead to detect the angle in a heartbeat loop,
Then if it detects the slope it will start adding force to the player depending on the angle.

yes this is a fraction of @justinmod 's code

In my opinion I would mostly rely on physics and “Instance.Velocity” even though roblox physics aren’t the best :frowning:

5 Likes

What would
This look like
I’m pretty dumb soo idk