Help With Velocity Collision

So I’m trying to make a on way collide able part like the video below. I’ve tried to use FMs, DevForum posts, YouTube videos but none of them work. I’d kinda like help with creating something like the video example below that runs off of the players velocity to make sure they can pass all the way through or collide the part so they can’t go through if they won’t make it all the way through. (What I think they use).

1 Like

I think it actually quite simple. You check where the Y Velocity is positive, and if it is, then make the CanCollide for the clouds false, otherwise, if it’s negative, then make it true.

Here’s the DevHub article on this.

Edit:
Here’s the code, it’s very simple (make sure this is in a Local Script):

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")
local clouds = {}

--add cloud objects to the table
for i, v in pairs(workspace:GetChildren()) do
	
	if v.Name == "Cloud" then
		
		table.insert(clouds, v)
		
	end
	
end

while true do
		
	local vel = hrp.Velocity.Y
	
	if vel > 0 then
		
		for i, cloud in pairs(clouds) do
		
			cloud.CanCollide = false
		
		end
		
	else
		
		for i, cloud in pairs(clouds) do
		
			cloud.CanCollide = true
		
		end
		
	end
	
	wait()
	
end
Also, here's the Server Script code that makes players jump higher
game.Players.PlayerAdded:Connect(function(player)
	
	player.CharacterAdded:Wait()
	local h = player.Character:WaitForChild("Humanoid")
	
	h.UseJumpPower = true
	h.JumpPower = 500
	
end)

Here’s the place file:
CloudJumping.rbxl (19.0 KB)

2 Likes