Ad
Log in to vote
0

How To Move A Model Using CFrame?

Asked by 1 year ago

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
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? GixxerK3 15 — 1y
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. BunnyFilms1 138 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

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.

Ad

Answer this question



Ad