Hello! I’ve been having some trouble on trying to propel players from the top side of a cylinder part. I’ve tried to use YVector/UpVector but they all launch the player straight up instead of launching the player from the top surface of the cylinder… I’m doing it in a local script, with HumanoidRootPart.Velocity. Any help please?
If you want to propel players from the top side of a part, you can use the BodyVelocity or BodyForce objects to apply a force in the desired direction.
– Assuming you have a part named “PropelPart” as the propelling surface
local propelPart = workspace.PropelPart
local function onTouched(part)
local humanoid = part.Parent:FindFirstChildWhichIsA(“Humanoid”)
if humanoid then
local forceDirection = (propelPart.CFrame.UpVector * 5000) – Adjust the magnitude as needed
local bodyVelocity = Instance.new(“BodyVelocity”)
bodyVelocity.Velocity = forceDirection
bodyVelocity.P = math.huge
bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyVelocity.Parent = humanoid
wait(0.1) – Adjust the delay as needed
bodyVelocity:Destroy()
end
end
propelPart.Touched:Connect(onTouched)
Oh, I’m doing it in a local script and with HumanoidRootPart.Velocity tho.
– Assuming you have a part named “PropelPart” as the propelling surface
local propelPart = workspace.PropelPart
local player = game.Players.LocalPlayer
local humanoid = player.Character and player.Character:FindFirstChild(“Humanoid”)
local function onTouched(part)
if part and part.Parent == humanoid.Parent then
local forceDirection = propelPart.CFrame.UpVector * 5000 – Adjust the magnitude as needed
humanoid.RootPart.Velocity = forceDirection
end
end
propelPart.Touched:Connect(onTouched)
I had said in the post that I have tried this and yet it does not seem to work
hmm very weird, good-luck on your project man!
Solved it, was something small…
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.