I would like to make a low gravity area on a spaceship place.
I have tried using a block that you can touch with the gravity api script:
Workspace | Documentation - Roblox Creator Hub
- – Calculate the moon’s gravity
- local moonGravityRatio = 1.62 / 9.81
- local defaultGravity = 196.2
- local moonGravity = defaultGravity * moonGravityRatio
- – Create a touch pad
- local pad = Instance.new(“Part”)
- pad.Size = Vector3.new(5, 1, 5)
- pad.Position = Vector3.new(0, 0.5, 0)
- pad.Anchored = true
- pad.BrickColor = BrickColor.new(“Bright green”)
- pad.Parent = workspace
- – Listen for pad touch
- local enabled = false
- local debounce = false
- pad.Touched:Connect(function(hit)
- if not debounce then
- debounce = true
- – Toggle gravity between moon and default
- enabled = not enabled
- workspace.Gravity = enabled and moonGravity or defaultGravity
- – Change pad color
- pad.BrickColor = enabled and BrickColor.new(“Bright red”) or BrickColor.new(“Bright green”)
- wait(1)
- debounce = false
- end
- end)
(the code from the page)
But I would like to make a “zone” that changes the gravity, but only in that said zone (similar to this game Ragdoll Sandbox Dev - Roblox )