```
local up = game.Workspace.Util.JoyPad.Up.ClickDetector
local down = game.Workspace.Util.JoyPad.Down.ClickDetector
local left = game.Workspace.Util.JoyPad.Left.ClickDetector
local right = game.Workspace.Util.JoyPad.Right.ClickDetector
local forward = game.Workspace.Util.JoyPad.Forward.ClickDetector
local backward = game.Workspace.Util.JoyPad.Backward.ClickDetector
local reset = game.Workspace.Util.JoyPad.Reset.ClickDetector
local part = game.Workspace.MovingPart
local startPos = part.Position
local function moveUp()
part.Position = part.Position + Vector3.new(0,10, 0)
end
local function moveDown()
part.Position = part.Position + Vector3.new(0,-10,0)
end
local function moveLeft()
part.Position = part.Position + Vector3.new(-10,0,0)
end
local function moveRight()
part.Position = part.Position + Vector3.new(10,0,0)
end
local function moveForward()
part.Position = part.Position + Vector3.new(0,0,10)
end
local function moveBackward()
part.Position = part.Position + Vector3.new(0,0,-10)
end
local function resetPart()
part.Position = startPos
end
up.MouseClick:Connect(moveUp)
down.MouseClick:Connect(moveDown)
left.MouseClick:Connect(moveLeft)
right.MouseClick:Connect(moveRight)
forward.MouseClick:Connect(moveForward)
backward.MouseClick:Connect(moveBackward)
reset.MouseClick:Connect(resetPart)
```
'tech > game' 카테고리의 다른 글
21/08/01 HOW TO MAKE YOUR OWN SKYBOX (CUBEMAP) IN ROBLOX STUDIO (0) | 2021.08.01 |
---|---|
21/08/01 Roblox Studio Tutorial: Pathfinding (0) | 2021.08.01 |
21/07/31 Roblox Studio Tutorial: Starting Menu (0) | 2021.07.31 |
21/07/31 Roblox Studio Tutorial: How to Make a Pop-up Menu (0) | 2021.07.31 |
21/07/31 How To Play ROBLOX In VR!! (0) | 2021.07.31 |