How would I enable Can Collide on client side?

  1. What do you want to achieve? Enable CanCollide for a client only

  2. What is the issue? only some of the platforms are getting changed

LocalScript in the player:

for i,v in pairs(Platforms) do
    if Platforms[i].Name == "Teal" then
	    Platforms[i].Transparency = 0
	    Platforms[i].CanCollide = true
	end
end
1 Like

The problem could be that certain platforms aren’t changing its collidable property because they are out of the player’s loaded area. To see if this is the case, try changing workspace’s property StreamingEnabled to false (temporarily) and see if you’re still encountering this issue. If this fixes it, we can look for a more permanent fix.

2 Likes

Maybe it’s the Platforms table not having those parts? Or maybe not all the platforms’s names are Teal? Also, instead of doing Platforms[i], just use v(from the for i, v)

That looks like that was the problem, thank you @xendatro. what would be a more permenent one?

Glad I could help!

Generally speaking, it’s best to keep StreamingEnabled on for performance purposes. Here are a couple solutions that would work alongside having StreamingEnabled set to true:

  1. Dynamic Loading: Have an event on the local side that makes platforms collidable when they “come into view” of a client. Essentially, this means checking to see when a platform is a descendant of Workspace. You can use Workspace.DescendantAdded (inherited from Instance) to achieve this.

  2. Collision Groups: This is my recommended method. On the server, you should make collision group logic so that way you can control whether a player can or cannot collide with the platforms. Unless you already have near the maximum number of collision groups (32, I believe), then I recommend this approach.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.