Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
kolenk 9
5 years ago

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?

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. BiIinear 104 — 5y
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 kolenk 9 — 5y
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. Daemonophobiaa 37 — 5y
0
You can try using the touched event, once the touch ends you can make its collisions true, use TouchEnded greatneil80 2647 — 5y

1 answer

Log in to vote
0
Answered by
BuDeep 214 Moderation Voter
5 years ago

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
0
You seem to get stuck some times while trying to jump through kolenk 9 — 5y
0
If its a single player game, put everything inside of local scripts so there's no client-server lag. BuDeep 214 — 5y
Ad

Answer this question