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

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

Asked by 5 years ago

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()
0
does it work if you change Position to CFrame aipiox123 1 — 5y
0
Same error, except Position is replaced with CFrame bruceywayne 35 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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

0
Same error, unfortunately. "TweenService:Create no property named 'CFrame' for object 'Mask'" bruceywayne 35 — 5y
0
Mask is a model or a part ? StarLordEnzoGamer 17 — 5y
0
i edit the answer StarLordEnzoGamer 17 — 5y
Ad

Answer this question