How to make an unanchored part float as if it was anchored

Title is self explanatory, I just want my part to float in the air so it can spin using torque as an alternative to a while true loop for spinning.

Use a VectorForce to counteract the force of gravity. Use the world-famous F=MA equation to calculate your force

2 Likes

U mind telling what the force would be set to in this case?

2 Likes

Did I not? I told you to use F=MA

2 Likes

ngl idk physics like that… I tried setting the y value of the vectorforce to -196.2 but nothin happening

2 Likes

It’s a kinematic equation. One of the simplest equations you’ll find in all of physics. Google it to understand what its components are

2 Likes

Got it, I’ll see what I can do

2 Likes

You can use an align position. That would be the easiest way to do it.

3 Likes

Also if you just want it to spin without being affected by outside forces you should really just use RunService with CFrames. It’d be better performance wise.

2 Likes

you could constrain it to an anchored part so it won’t move

2 Likes

That would be less laggy than this?

while task.wait() do
	script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.7,0)
end

(The script above doesn’t necessarily lag the game, but I feel like there could be a better practice)

2 Likes

This is not ideal because the velocity will keep increasing forever, which could make the part appear more jittery over time. You need to use physics movers like AlignPosition or BodyGyro.

What are you trying to do? Make a part spin in mid air with physics? You can study models like this in the toolbox to figure out how they do it.

2 Likes

It’s really just for a vfx slash, it isn’t even in the workspace for too long. I was mainly looking for an alternative to the spin script I’m using

1 Like

Well, if it’s not physics based, you should use RunService.RenderStepped to update the rotation. Or you may use TweenService, if it has a simple predictable animation.

3 Likes

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