I need gravity for my new dropper game but sometimes when I walk/jump in the part who give the gravity sometimes its give the wrong gravity.
I have two script to the part, one that teleport and one who do the gravity
gravity script its local script inside startercharacterscripts
local part = workspace.NormalLobby.TryTheObbyTeleport.ChangingAnimationAndStart.Part
workspace.Gravity = game.ReplicatedStorage.GravityNormal.Value
function onTouch(hit)
local Hum = hit.Parent:FindFirstChild("Humanoid")
if Hum and hit.Parent.Name == game.Players.LocalPlayer.Name then
workspace.Gravity /=40
end
end
part.Touched:connect(onTouch)
I don’t send the second script I don’t think its ineed.
(the link its video, I dont really know how to send video like normal here im new to roblox forum)
Maybe try adding a debounce, so that when you touch the part it doesn’t spam divide the gravity.
Something like this:
local part = workspace.NormalLobby.TryTheObbyTeleport.ChangingAnimationAndStart.Part
workspace.Gravity = game.ReplicatedStorage.GravityNormal.Value
local debounce = false
local timeout = 0.5
function onTouch(hit)
local Hum = hit.Parent:FindFirstChild("Humanoid")
if Hum and hit.Parent.Name == game.Players.LocalPlayer.Name and not debounce then
debounce = true
workspace.Gravity /=40
task.wait(timeout)
debounce = false
end
end
part.Touched:connect(onTouch)
When any part of the character touches the gravity zone, the gravity is divided by 40. This will most likely cut the gravity all the way into 0. Instead, set a specific gravity on touch.
you can give example I didn’t understand the “set a specific gravity on touch.” I did part that if you touch it its will change the gravity like you saw what i said at start
You could try using some body movers which modify the physics of it’s parent. So in this case, the HumanoidRootPart of the player in the dropper. These are deprecated, but they still work perfectly fine. One of the body movers might be the solution. You basically just want the character to fall down at a constant speed. I can’t test which one will work the best right now, sorry!
well thanks for trying to help, I will try to check it , but i dont have very much skills at scripting or i can say i dont have skills at all, If you find solution btw please say it cuz prob I can’t do it I have been trying to fix my all gravity for days