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

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

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.

function TransformOffset(model, center, new) -- new is irrelevant, can be used as a Rotation matrix but I dont want to change angles in this case

	    for _,v in pairs(model)do

	        if v:IsA("BasePart")or v:IsA("UnionOperation") then

	            v.CFrame=v.CFrame*center

	        end

	        --TransformModel(v,center,new)

	    end

end

1 answer

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

2 comments

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.

0

Okay

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