Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to detect where an object is going to land?

I am currently working on scripting a football. I am trying to figure out a way to know where the ball is going to land, after being thrown. Is this possible? If so, how?

1 comment

0

You should check out EgoMoose's excellent "Modeling a projectile' s motion". This can help you do what you are trying to do. https://scriptinghelpers.org/guides/modeling-a-projectiles-motion

1 answer

✓ Accepted answer

You can check if the football touched something:

game.Workspace.FootBall.Touched:Connect(function()
	local LandedPosition = game.Workspace.FootBall.Position
end)

You don,t need to check if the thing that touched the football is a player, cuz it can also be the basepart, etc.

NOTE: THE FOOTBALL HAS TO BE A PART, NOT A MODEL.

This function will get the part located at the center of the football.

If you wanted to the football to land on a specific part, do this:

game.Workspace.FootBall.Touched:Connect(function(hit)
	if hit.Name == "the specific part's name" then
		local LandedOnPart = hit
	end
end)

Hope this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.