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

How do I rotate and move a model using a Primary Part?

Hello!

I have a model that has a few parts and I have the Primary Part set to one of the parts inside the model. How would I move the model while rotating it as well? As a reference, the model is an Iron Man helmet and I want to move the faceplate like in the movies when it opens up. I tried using the TweenService but it tells me "TweenService:Create no property named 'Position' for object 'Mask'"

This is what I have so far:

local helmet = game.Workspace["Iron Man Bleeding Edge"].Helmet
local mask = helmet.Mask

local tweeningInformation = TweenInfo.new(
	5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local partProperties = {
	Position = mask:GetPrimaryPartCFrame() * CFrame.new(0, 10, 0)
}

local Tween = tweenService:Create(mask,tweeningInformation,partProperties)

wait(10)

Tween:Play()

2 comments

0

does it work if you change Position to CFrame

0

Same error, except Position is replaced with CFrame

1 answer

So, heres the fixed script:

local helmet = game.Workspace["Iron Man Bleeding Edge"].Helmet
local mask = helmet.Mask
 
local tweeningInformation = TweenInfo.new(
    5,
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)
 
local partProperties = {
   CFrame = mask:GetPrimaryPartCFrame() * CFrame.Angles(0, 10, 0)
}
local Tween = tweenService:Create(mask.PrimaryPart,tweeningInformation,partProperties)
	 
wait(10)
 
Tween:Play()

edit: i hope it works now The problem was: You were tweening the position, but you insert a CFrame value there. I hope it helps! And if it did, accept the anwser :D

3 comments

0

Same error, unfortunately. "TweenService:Create no property named 'CFrame' for object 'Mask'"

0

Mask is a model or a part ?

0

i edit the answer

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