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

what the heck is LineForce.Magnitude?

hello,

I am trying to create a simpler MoveTo function without humanoids. I know some folks who did it with the older body movers. it seems likes LineForces would be the best constraint to tackle this issue with att0 on the rig and att1 at the destination.

I’ve been trying to figure out the details on a LineForce but the info seems to be few and far between. the dev hub tells me that the strength of the force is based on LineForce.Magnitude. err, doesn’t say how. is it supposed to be studs per second?

additionally, is it possible to tell when the attachment has reached its destination using the force alone or will I have to do something else? I am open to other ideas too, so I can scrap LineForces altogether, but I have used TweenService already and it’s way too limiting compared to a force cause the characters can’t be pushed around without fake physics. there’s a reason people used body forces already, but those are outdated.

here’s the api page

2 comments

1

Why don't you use TweenService?

0

indeed, I thought of that originally and did implement it. the lineforce, though, seems a lot more versatile as I can apply other forces much easier without just “simulating”... if I can find out how it works, that is.

1 answer

You can use TweenService. It's way simpler to understand. It simply moves the assigned instance to the desired position smoothly.

TS = game:GetService("TweenService")
local PartToMove = ___________ --The part you want to move

local goal = {}
goal.Position = EndPosition
local tweenInfo = TweenInfo.new(
	2, -- Exact time it takes to reach the point
	Enum.EasingStyle.Sine, -- EasingStyle
	Enum.EasingDirection.InOut, -- EasingDirection
)

Tween = TS:Create(PartToMove, tweenInfo, {Position = EndPosition})
Tween:Play()

1 comment

0

thanks a lot for your answer. I’ve actually... done that already, you can check the comments. I suppose I should edit that into my question.

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