Hey guys! I am releasing my new game Tunnel Run on June 10th, but I have come across a problem. Essentially, one of the sections of the obstacle course involves moving platforms. These, of course, are handled on the client, as to avoid delay on each user’s end. However, whenever the platforms are created via local parts, they still collide with other players. How would I get around this? Note: I have a CollisionGroup called Players, but it is used to prevent player to player collision. Thanks!
How are you going about these local parts? If a part is local, then no person other than the owner should be able to observe and collide with that part. This would lead me to believe you managed the parts improperly in someway that have the server replicate to all clients. Did you forget the platform is on the server at the start and delete them individually with localscripts on the client?
Edit: Proof reading and some more words
So my game chooses random sections. Within some sections, exists a ModuleScript that performs a local function on the section. This just means it is held on the client side and performs various functions.
Here is the module for the troubled section:
local SectionHolder = workspace:WaitForChild("SectionHolder")
local Section = script.Parent
local Special = Section:FindFirstChild("Special")
local MovingPlatforms = Special:FindFirstChild("MovingPlatforms")
local function LocalFunction()
if Section and Section.Parent == SectionHolder then
for _, PlatformSet in pairs(MovingPlatforms:GetChildren()) do
local Pos1 = PlatformSet:FindFirstChild("Pos1")
local Pos2 = PlatformSet:FindFirstChild("Pos2")
local WaitTime = PlatformSet:FindFirstChild("WaitTime").Value
local Speed = PlatformSet:FindFirstChild("Speed").Value
local Platform = Instance.new("Part")
Platform.Name = "MovingPlatform"
Platform.Size = Vector3.new(6,1,6)
Platform.BrickColor = BrickColor.new("Fawn brown")
Platform.Material = Enum.Material.SmoothPlastic
local Gyro = Instance.new("BodyGyro")
Gyro.D = 500
Gyro.P = 3000
Gyro.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
Gyro.Parent = Platform
local Attachment = Instance.new("Attachment")
Attachment.Position = Vector3.new(0,0.5,0)
Attachment.Orientation = Vector3.new(0,0,90)
Attachment.Parent = Platform
local Align = Instance.new("AlignPosition")
Align.MaxForce = 100000000
Align.MaxVelocity = Speed
Align.Responsiveness = 50
Align.Attachment0 = Attachment
Align.Attachment1 = Pos1:FindFirstChild("Attachment")
Align.Parent = Platform
Platform.CFrame = Pos1.CFrame
Platform.Parent = Special
coroutine.wrap(function()
wait(3)
while Section and Section.Parent == SectionHolder do
if Section and Section.Parent == SectionHolder then
Platform:FindFirstChild("AlignPosition").Attachment1 = Pos2:FindFirstChild("Attachment")
else
break
end
wait(WaitTime)
Platform.Position = Pos2.Position
if Section and Section.Parent == SectionHolder then
Platform:FindFirstChild("AlignPosition").Attachment1 = Pos1:FindFirstChild("Attachment")
else
break
end
wait(WaitTime)
Platform.Position = Pos1.Position
end
end)()
end
end
end
return LocalFunction
What is “PlatformSet”? Is this just a folder or model, or is it a BasePart?
Assuming everything being ran is local and PlatformSet is not an object that the players are colliding with, then I’d suggest you run a server test with at least 2 players in studio and see if you can get the collision issue to occur. If so, then you should be able to go through the workspace of the 2 players and compare with eachother and the server to find out what is wrong.
There should be some collision render option in studio somewhere, but I don’t recall where to enable it.
So basically PlatformSet contains the two parts that represent the positions. This is on the server. However the part is created locally.