You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I have an elevator for my Difficulty chart obby (based off of the one in Tiny’s Difficulty Chart Obby Remastered
What is the issue? Include screenshots / videos if possible!
The issue is that the elevator looks very weird and is very buggy. (See GIF below, sorry for the lag)
local de = false
script.Parent.Touched:Connect(function(hit)
if de == false then
de = true
local char = hit.Parent
if char:FindFirstChild("HumanoidRootPart") then
local hRoot = char:FindFirstChild("HumanoidRootPart")
hRoot.Position = Vector3.new(hRoot.Position.X, hRoot.Position.Y + 1, hRoot.Position.Z)
end
de = false
end
end)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
No, I can’t think of any solutions.
A BodyVelocity is basically a Velocity object that can move a part relative to physics
It would be considered a better approach instead of just moving the Character’s HumanoidRootPart Position, or better yet you can use TweenService to tween the Character’s Position that way
One Instance that I see is that there’s literally no cooldown when you’re attempting to change the Position of the HRP
local de = false
script.Parent.Touched:Connect(function(hit)
if de == false then
de = true
local char = hit.Parent
if char:FindFirstChild("HumanoidRootPart") then
local hRoot = char:FindFirstChild("HumanoidRootPart")
hRoot.Position += Vector3.new(0, 1, 0)
end
wait(5)
de = false
end
end)
Also you’re moving the HRP’s Position very small, shouldn’t you be moving the Elevator Part instead like you mentioned before? Cause I don’t exactly see a “Elevator” to move
This is possibly due to the fact that the Humanoid’s State keeps changing back to Jumping every time the Character touches the part (Looking at the video here)
What you could do, is make the Character jump again after a certain interval of seconds have passed
local de = false
script.Parent.Touched:Connect(function(hit)
if de == false then
de = true
local char = hit.Parent
if char:FindFirstChild("HumanoidRootPart") then
local hRoot = char.HumanoidRootPart
local Humanoid = char.Humanoid
Humanoid.JumpPower = 75
Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
wait(1)
Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
Humanoid.JumpPower = 50
end
wait(5)
de = false
end
end)
You’ll probably need to keep forcing the Humanoid every time they touch the part then
local de = false
script.Parent.Touched:Connect(function(hit)
if de == false then
de = true
local char = hit.Parent
if char:FindFirstChild("HumanoidRootPart") then
local hRoot = char.HumanoidRootPart
local Humanoid = char.Humanoid
Humanoid.JumpPower = 75
Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
wait(0.5)
de = false
end
end)