Tween is broken in game

help my orientation tween is broken.In studio is perfectly fine but when in the game the orientation gone opposite

in studio =
close:
studio2
open:
studio

in game=
close:
close door game
open:
opendoorgame

also this happen to all my asset with the same script and tween
help meee…

local tweenservice = game:GetService("TweenService")
local hinge = script.Parent:WaitForChild("Hinge")

local tweeninfo = TweenInfo.new(

	0.5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local tweeninfo2 = TweenInfo.new(

	0.5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.In,
	0,
	false,
	0
)

local open = tweenservice:Create(hinge, tweeninfo ,{Orientation = Vector3.new(0, -155, -70), Position = Vector3.new(-19.681, 6.708, 108.054)})
local close = tweenservice:Create(hinge, tweeninfo2 ,{Orientation = Vector3.new(0, -155, 0), Position = Vector3.new(-17.745, 8.195, 107.151)})

local function Check()
	local Door = game.Workspace.OpenGarage

	local MinRegion = Door.Position - (Door.Size / 2)
	local MaxRegion = Door.Position + (Door.Size / 2)

	local DoorRegion = Region3.new(MinRegion, MaxRegion)

	local Whitelist = {} -- The whitelist of parts can be found by Region3, we will make it only detects player.

	for _, Player in pairs(game.Players:GetPlayers()) do
		if Player.Character then
			table.insert(Whitelist, Player.Character.PrimaryPart)
		end
	end

	local TouchingPart = workspace:FindPartsInRegion3WithWhiteList(DoorRegion, Whitelist)
	if #TouchingPart == 0 then
		close:Play()
		close.Completed:Wait(0.01)
	else
		open:Play()
		open.Completed:Wait(0.01)
	end
end

while wait(0.1) do
	Check()
end

this is door detect player script

1 Like

sometimes when using orientation on an entire model rather than a single part messes things up. I can help you. Union whatever you are trying to orient and then try

2 Likes

ok, and is a mesh and its cylinder so it cannot make it union

1 Like

hmm. is the tweened part anchored? That might help

1 Like

ABSOLUTELY , how can the tweened work without anchored the hinge

1 Like

hey, do you think is a lag problem because well in my game THERE IS TON OF TREE AND I MEAN TONSS

1 Like

it could be. It also sometimes changes if the tweens are local or client sided

2 Likes

ok it work thx i deleted a bunch of it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.