Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

CFrame to move model relative to Center point (required ? mark here)

Asked by 8 years ago

I am trying to use CFrame to animate some models. I have a block called Center that is continuously moving. I want to move the Model relative to Center's movement. This is the code I have (but the model disappears when I run the function)

How do I make this work right? Thanks.

01function TransformOffset(model, center, new) -- new is irrelevant, can be used as a Rotation matrix but I dont want to change angles in this case
02 
03        for _,v in pairs(model)do
04 
05            if v:IsA("BasePart")or v:IsA("UnionOperation") then
06 
07                v.CFrame=v.CFrame*center
08 
09            end
10 
11            --TransformModel(v,center,new)
12 
13        end
14 
15end

1 answer

Log in to vote
0
Answered by 8 years ago

I have asked a similar question and had it answered here. Hope this helps.

0
I appreciate the link, but sadly the Center part is part of a different model than the one I want to move so the function won't work. patrline5599 150 — 8y
0
Okay UltChowsk 85 — 8y
Ad

Answer this question