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

Why does changing a part's position cause the part to go above another? (Solved)

Asked by
Mayk728 855 Moderation Voter
6 years ago
Edited 6 years ago

I have a door, which is fit into a wall. I have a script for whenever a player touches the door, it opens / closes. I'm using TweenService so the door can move from one position to the other. The whole door is one part, so there is nothing else that needs to be tweened.

The main issue i'm having is once a player touches the door, the door moves all the way to the top of the house, then tweens. I have no idea why this is happening, any solutions?

GIF of what happens

Part of the script:

local TweenService = game:GetService('TweenService')
local OpenGoal = {}
OpenGoal.Orientation = Vector3.new(0,100,0)
local OpenTween = TweenService:Create(Door,Info,OpenGoal)
OpenTween:Play()

I've already tried setting CanCollide to false and true but it didn't work.

EDIT: I solved this by simply using CFrame.fromOrientation() instead of Part.Orientation. Appearantly only CFrame allows colliding.

0
The door is probably clipping with the house meaning parts are overlapping. I'm guessing attachment orientation properties (never used them before myself) don't allow for this to happen just like how the Position property will set things ontop of one another to avoid collision of parts. Try making sure the door will not collide with the house (like make it a little smaller)? User#18718 0 — 6y
0
If i make it smaller, there will be small gaps between the door and the walls, which is not what I want. Is there not any way to allow them to collide? Setting CanCollide to true or false doesn't seem to work. Mayk728 855 — 6y

Answer this question