Smoothing a flip without it jerking or flipping over

I used physics and cframe to see which would do better but so far nothing is smooth enough.

here’s what the part is supposed to do is…
flip to an assigned destination while maintaining a smooth jump and rotation
WHILE:
not bending over
not flipping over
not jerking

my script:

local function rotateBottle(plrBottle: MeshPart, duration : number)
	local av = Instance.new("AngularVelocity")
	av.RelativeTo = Enum.ActuatorRelativeTo.World
	local spinRate = (2 * math.pi) / duration
	av.AngularVelocity = Vector3.new(0,0,spinRate)
	av.MaxTorque = math.huge
	av.Parent = plrBottle
	av.Attachment0 = plrBottle.Attachment
	av.Attachment0.Position = plrBottle.CenterOfMass
	game.Debris:AddItem(av, duration)
end
plrBottle:ApplyImpulse(force * plrBottle.AssemblyMass)

should i keep using cframe or continue with physics.
with cframe ive experienced jerky movements
but physics has its drawback where i cant find a way to keep it straight up.

any help is appreciated, thanks


1 Like

It’s like this but with spinning. Only problem is when the part spins it also carries the momentum with it- and if the edges of the part hit the baseplate…

it transfers the energy.

another example

made some changes and got this. half correct half wrong. but when i remove the “divide 2” none gets right

You could make your own physics which is more simplistic

please provide an example. I just searched this up got something related to multithreading

If I understood correctly, then the problem when using physics is due to the network owner being switched mid flip and with CFrames due to latency. I would personally use CFrames, as they’re more performant and more reliable/preditcable. When using physics, roblox automatically sets the network ownership (aka who does the physics) to the client when the unanchored part gets close enough to the player. You can override this behaviour by calling Part:SetNetworkOwnership(player) to permanently keep it on the player (or to nil to permanently keep it on the server). If you’re using CFrames then afaik the best thing you can do is do all the flipping on the client, which would anyway be the best option.