I’m trying to tween a model for a sliding door I’m making. I’ve been getting the error “Unable to cast to Dictionary” and got stuck on what I was doing wrong. I’m making a grid placement system (or at least I’m going to try to) and it’s not a stationary door so the end positions will always be different. “doorLocation” is also the initial position of the door for the slide back tween. What did I do wrong?
Script:
local Detectionzone = script.Parent.DetectionZone
local TweenService = game:GetService("TweenService")
local door = script.Parent.Door -- The Sliding Door Model
local doorSound = script.Parent.DoorSound -- Sound For Door.
local doorLocation = door.PrimaryPart.CFrame -- Initial Door Model Position
local endTweenLocation = script.Parent.EndPos.CFrame -- End Position For The Tween (A part)
local tweenmovement = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
0,
false,
0
)
local doorOpenTween = TweenService:Create(door,tweenmovement,endTweenLocation)
local doorCloseTween = TweenService:Create(door,tweenmovement,doorLocation)
Sorry if my code is messy…