I'm trying to make a part move to a location while retaining its orientation, but the part always moves back to (0,0,0) orientation. Please Help!

Heres A video to help with what is happening: https://www.youtube.com/watch?v=K3eSOWu4g8M&feature=youtu.be

--Code--

local TweenService = game:GetService("TweenService")

local part = script.Parent.Parent.MainPart

local tweeninginfo = TweenInfo.new(
	10,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)
local part1 = {CFrame = CFrame.new(-280.05, -12.278, 123.75)}
local part2 = {CFrame = CFrame.new(-287.57, -12.278, 117.299)}

local parttween = TweenService:Create(part,tweeninginfo,part1)
local parttweenback = TweenService:Create(part,tweeninginfo,part2)

local Debounce, Delay = true, 10 -- durration
Debounce = true

script.Parent.Touched:Connect(function()
	Debounce = false      --------- i know, i did not write Debounce correctly
	tween1close:Play()
	parttween:Play()
	wait(10)
	tween1open:Play()
	parttweenback:Play()
	Debounce = true
end)

3 comments

0

Idk why it does this. The coords have to be very exact or it probably won't work. This is a problem that's annoying I don't think there are many ways to fix this but you can always try rotating the block to the correct position

0

CFrame.new(Vector3 position, Vector3 lookAt)

0

This Worked Ty!