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

Tweening the orientation of a part is also changing the position?

Asked by 3 years ago

I have this model of a door, and when I test it straight out of workspace, it works fine, however when I pull it out of ServerStorage and then test it, the model rotates and changes its position to an area across the map. Anyone see anything in my code that might be causing this?

local TweenService = game:GetService("TweenService")
local door = script.Parent
local doorRoot = door.PrimaryPart
local proxPrompt1 = door:WaitForChild("Prox1"):FindFirstChild("ProximityPrompt")
local proxPrompt2 = door:WaitForChild("Prox2"):FindFirstChild("ProximityPrompt")


local doorSwingInfo = TweenInfo.new()

local doorOpenTween = TweenService:Create(doorRoot, doorSwingInfo, {
    CFrame = doorRoot.CFrame * CFrame.Angles(0, math.rad(90), 0)})

local doorCloseTween = TweenService:Create(doorRoot, doorSwingInfo, {
    CFrame = doorRoot.CFrame * CFrame.Angles(0, math.rad(0), 0)})

0
Can you say the errors in the output? SynnDC 8 — 3y

Answer this question