Hello, I’m trying to make a smash game on Roblox. I want to make it so that the player can jump from under the object like in smash. I made this script, but "hey!"
is never printed.
Their are no error’s, what do I do??
local char = script.Parent
local hrp = char:WaitForChild("HumanoidRootPart")
local head = char:WaitForChild("Head")
local rayOrigion = Vector3.new(0, 8.25, 0)
local rayDirection = Vector3.new(0, 10, 0)
local raycastResult = workspace:Raycast(rayOrigion, rayDirection)
local part = Instance.new("Part", workspace)
part.Anchored = true
part.Position = rayOrigion
part.Size = (rayDirection - rayOrigion) + Vector3.new(1, 0, 1)
part.BrickColor = BrickColor.new("Persimmon")
part.CanCollide = false
part.Position = head.Position + Vector3.new(0, 1, 0)
local function touched(part)
if part.Name == "floatingPlatform" then
print("hey!")
end
end
game:GetService("RunService").RenderStepped:Connect(function()
part.Position = head.Position + Vector3.new(0, 1, 0)
end)
part.Touched:Connect(touched)