Log in to vote

My door parts are going on top of my door when I tween it? [closed]

Asked by 2 years ago

I have a door, and 2 union parts which are the sides that slide out when tweened, but when I try it they still tween to the right position, but just get pushed on top of the door. When I turned off "CanCollide" in all the parts and unions of the door it worked, but it seems it doesn't tween properly when CanCollide is on for everything. But when I have CanCollide off for everything I can walk through it which is an issue.

Gif of CanCollide on for everything (Broken version)

Gif of CanCollide off for everything (Working version)

And here is the script I use to handle the tweening

local tweenService = game:GetService("TweenService")
local part = script.Parent.Parent.Parent.d1.Union
local part2 = script.Parent.Parent.Parent.d2.Union

local function onCard(hit)

    local tweeningInformation =

    local partProperties = {
    Position =, 3.451, 32.719)

    local partProperties2 = {
    Position =, 3.302, 32.719)

    local Tween = tweenService:Create(part,tweeningInformation,partProperties)
    local Tween = tweenService:Create(part2,tweeningInformation,partProperties2)


Locked by User#24403

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
Answered by 2 years ago

Basically, the problem here is that you are tweening with Position


The position property of a part, like velocity and Orientation, factors in collisions. If the part is colliding with the hitbox of another object. However, BodyMovers such as BodyPositions, BodyGyros, Bodyforces , BodyVelocities can combat this.


If you do not want to bodymovers and just want to tween it, use the CFrame property of the part. CFrame, unlike position does not factor in collisions. So it can do things you can't do with positions and going through walls. The transfer from Position to CFrame is actually pretty easy as you can directly inputting the position of the CFrame matrix without doing anything with the orientation like such :, with all that said, tweening the cframe can be done like such :

local ts = game:GetService("TweenService")
local tinfo =,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
local part = workspace.Part

local t = ts:Create(part,tinfo,{CFrame =, 3.302, 32.719))})
Thank you for the informative answer, it helped me a lot and the door works with much less code. Also I learned some stuff about moving parts! Superameno 34 — 2y