Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I slide across a wedge?

Asked by 8 years ago

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

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

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
0
Thanks! Zounx1350 5 — 8y
Ad
Log in to vote
-2
Answered by
Jephi 42
8 years ago

Change it to *-100

don't know if it will work

Answer this question