Ad
Log in to vote
0

How To Move A Model Using CFrame?

Asked by 9 months 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 — 9mo
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 131 — 9mo

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

1 answer

Log in to vote
0
Answered by 9 months ago
Edited 9 months 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