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

How To Move A Model Using CFrame?

I am attempting to make this CFrame script work on moving a model rather than one individual part. What edits would I need to make to this script so it could move a model?

local model = script.Parent.Parent
local platform = model.platform
local one = model.pointa
local two = model.pointb
local three = model.pointc
local bodyPos = platform.BodyPosition
local time = 2 

while true do
	bodyPos.position = one.Position
	wait(time)
	bodyPos.position = two.Position
	wait(time)
	bodyPos.position = three.Position
	wait(time)
end

2 comments

0

Why are some of your properties ".position" while others are ".Position"? It'd help to know a little more about the layout of your model too. Is model.platform another Model? Is it a Part? Some other instance? What about model.pointa and model.pointb? See what I'm getting at?

0

So the model.platform is a part, and the pointa,pointb,pointc are all "points" that the script has the part (platform) go to.

1 answer

✓ Accepted answer

Make sure that the BodyPosition.MaxForce values you are using are high enough to overcome the mass of your platform.

For example, try:

bodyPos.MaxForce = Vector3.new(0, game.Workspace.Gravity * 1.1, 0) * platorm:GetMass()

This will apply an upward force on the platform of 1.1 times the force of gravity. That should lift it relatively slowly.

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