Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I slide across a wedge?

Okay, I'm trying to make it so that I can slide across a wedge, but so far

print("hello")
while true do
script.Parent.Velocity = script.Parent.CFrame.lookVector *100
wait(0.1)
end

That makes it so that I slide DOWN the wedge, is there any way that I can slide across? I'm not asking for the script in itself, just a hint or a way to fix it. Thanks!

2 answers

You want the direction down the face of the hypotenuse of the wedge. This will get the slope and convert the block-face normal into the direction perpendicular to the hypotenuse normal.

workspace.Wedge.Velocity = (workspace.Wedge.CFrame * CFrame.new(Vector3.new(0, workspace.Wedge.Size.Y, -workspace.Wedge.Size.Z), Vector3.new(0, -workspace.Wedge.Size.Y, workspace.Wedge.Size.Z))).lookVector * 100

1 comment

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.