How to fling objects in Roblox? (fling effect)

Trying got get an effect where objects can fling.

Somthing similar to Teapots of Doom.
Example:
Teapots of Doom video

How do I make it so that a part can fling from one side of the map to the other?

If anyone knows how, please let me know, thank you.

To achieve a fling effect similar to Teapots of Doom, you can use physics simulation. Here is a basic
example:

local part = script.Parent

local bodyForce = Instance.new("BodyForce")
bodyForce.force = Vector3.new(100, 0, 0) -- Apply force in the x direction
bodyForce.Parent = part

part.Anchored = false -- Allow the part to move with the force

game:GetService("RunService").Stepped:Connect(function()
	if part.Position.X > 100 then -- Stop applying force when part has moved far enough
		bodyForce:Destroy()
	end
end)
4 Likes

Small nitpick, but you should use BodyForce.Force instead of BodyForce.force.

As a note of this, BodyForce belongs to the legacy body movers which are all deprecated in favor of constraint-based movers instead. Those work essentially the same, there is one for each as far as I know.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.