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

Make a player walk on walls?

Asked by 6 years ago

Hello! I am attempting to make a script so that when a player touches a brick, they can walk on the wall. I'm not sure if this is the best way, but im trying turn the players z axis without them flipping back up.

This is the code that I have:

script.Parent.Touched:connect(function(hit)
    local player = hit.Parent
    player.Torso.Orientation = Vector3.new(0, 0, 90)
end)

The player dies when it is touched. Anyone know how to fix this or have a better way for players to walk on walls?

0
Yes, use CFrame. Professor_Boxtrot 136 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

The easiest way to do this is to use CFrame, as I stated in my comment.

CFrame is a type of data that holds orientation and position, and it doesn't kill the player upon use. Try this:


script.Parent.Touched:connect(function(hit) local player = hit.Parent player.Torso.CFrame = CFrame.Angles(0,0,90) end)
0
Well that script apparently flings the player and they get their head stuck in the ground whilst upside down. TehHyperGamer 0 — 6y
0
You need to get the normal of the wall surface... Professor_Boxtrot 136 — 6y
0
For me, it does completely nothing. ScriptsALot 91 — 5y
Ad

Answer this question