Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a platform that you can go through but stand on?

So, I'm trying to make a platform that you can jump through, but when you land on it you're able to stand on it. This is what I came up with so far.

platform = game.Workspace.Platform

platform.CanCollide = false
platform.Touched:Connect(function(hit)
	wait(.1)
	platform.CanCollide = true
		
end)



Any help please?

4 comments

0

So its like a platform from Mario? I've seen a question like this before, I think you'd have to use Collision Groups.

0

I think it would be like mario platforms I was thinking more like smash bros and I'm not really sure how to use collison groups

0

Try collision groups. If not, then.. Well I guess you can put an invisible part below the platform which detects if a player touches it and when it does, the platform's CanCollide turns into false for a short time before CanCollide turns back on. I still recommend you learn about Collision Groups.

0

You can try using the touched event, once the touch ends you can make its collisions true, use TouchEnded

1 answer

✓ Accepted answer

You can use either collision groups:

https://developer.roblox.com/en-us/articles/Collision-Filtering

Or I suppose you could have a check system that whenever a player is below a certain point in the world, set the part to non-collidable then when their above a certain point, set the part to collidable. I'd put the script inside of the player and have different parameters set for different part.

An example below:

local part1 = workspace.Part1
local part1_setpt = 5 -- Y studs in workspace

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local char = player.Character
local head = char:WaitForChild('Head')

while wait() do
	if head.Position.Y >= part1_setpt then
		part1.CanCollide = true
	else
		part1.CanCollide = false
	end
end

2 comments

0

You seem to get stuck some times while trying to jump through

0

If its a single player game, put everything inside of local scripts so there's no client-server lag.

This discussion is preserved as it was. New answers, comments, and votes are closed.