I made a one-way platform similar to that found Super Smash Bros however the collisions work client and server-side meaning when I change the CanCollide property to true in the client, the server picks it up not allowing other players to also have the same non-CanCollide effect. Is there a way to make an object collidable for one player but not another
1 Like
Setting CanCollide on on a door on client should only effect that client. (Apart from maybe a couple of unusual edge cases if the door is unanchored) It seems more likely that you’ve got a bug causing it to change on the server, or are accidentally causing it to happen on all the clients.
2 Likes
Orange: Detector
Red: Platform
Detector1.Touched:Connect(function(object)
if object.Name == "Head" then
Platform1.BrickColor = BrickColor.Green()
Platform1.CanCollide = true
end
end)
Detector1.TouchEnded:Connect(function(object)
if object.Name == "Head" then
Platform1.BrickColor = BrickColor.Red()
Platform1.CanCollide = false
end
end)
this is what my solution is
After messing around for a bit, I found that making sure Detector1’s event isn’t being triggered by other players’ heads worked fine.
local pl = game.Players.LocalPlayer
local ch = pl.Character or pl.CharacterAdded:Wait()
local Detector1 = workspace.collider
local Platform1 = workspace.changer
Detector1.Touched:Connect(function(object)
if object == ch.Head then
Platform1.BrickColor = BrickColor.Green()
Platform1.CanCollide = true
end
end)
Detector1.TouchEnded:Connect(function(object)
if object == ch.Head then
Platform1.BrickColor = BrickColor.Red()
Platform1.CanCollide = false
end
end)