I’m currently wondering how you could allow a player to move in a specific orbit only? (red cylinder part is supposed to illustrate where you could move using the keys “A (left)” and “D (right)”.
I’m not sure how to go on about this and I would appreciate what I could potentially do to achieve this.
I’m trying to figure out how to use it before I implement key control. It doesn’t work as intended. I’m not sure what I am doing wrong.
Server Script:
local RunService = game:GetService("RunService")
local Circle = game.Workspace.Cylinder
RunService.Heartbeat:Connect(function()
for i,v in pairs(game.Players:GetPlayers()) do
local angleAmount = math.pi*2/#game.Players:GetPlayers()
local multiplier = 3
local yValue = 2
local pos = Vector3.new(math.sin(angleAmount*i)*multiplier, yValue, math.cos(angleAmount*i)*multiplier) + Circle.Position
v.Character:MoveTo(pos)
end
end)
Can you describe the issue? If you’re getting an error saying you can’t “attempt to index nil with ‘MoveTo’”, it’s because you need to check to see if the character loaded.