Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

repeat wait() until workspace:FindFirstChild("Ball")-- Constantslocal

UserInputService = game:GetService("UserInputService")local RunService =


game:GetService("RunService")-- Markerlocal Marker =
Instance.new("Part")Marker.Name = "Marker"Marker.Size = Vector3.new(2, 2,
2)Marker.Shape = Enum.PartType.BallMarker.BrickColor = BrickColor.new("Bright
violet")Marker.CanCollide = falseMarker.Anchored = trueMarker.Parent =
workspaceMarker.Transparency = 1Marker.Material = Enum.Material.Neon-- Physicslocal
function PHYSICS_STUFF(velocity, position) local acceleration = -
workspace.Gravity local timeToLand = (-velocity.y - math.sqrt(velocity.y * velocity
.y - 4 * 0.5 *acceleration * position.y)) / (2 * 0.5 *
acceleration) local horizontalVelocity = Vector3.new(velocity.x, 0, velocity.z) loc
al landingPosition = position + horizontalVelocity * timeToLand +Vector3.new(0, -
position.y, 0) return landingPositionend--
ConstructRunService:BindToRenderStep("VisualizeLandingPosition",Enum.RenderPriority
.Camera.Value,
function() Marker.Transparency = 0.5 for _, ballModel in ipairs(workspace:GetChildr
en()) do if ballModel:IsA("Model") and ballModel.Name == "Ball" then local ball = b
allModel:FindFirstChild("BallPart") if ball then local initialVelocity = ballModel.
Velocity local landingPosition = PHYSICS_STUFF(initialVelocity.Value,ball.Position)
Marker.CFrame = CFrame.new(landingPosition) end end endend

You might also like