So, I’m working on an escape room and I scripted a key code chest. Once it’s correct, the tween on the red brick should rotate and pull the top of the chest top open on the hinge. I used a qPerfection welding script on the top of the chest so it should work as it was planned. However, when I test the game in-studio, the red brick tweens and rotates itself without taking the unanchored welded model with it when it’s clearly welded to a welded model top. This used to work fine, but now, I’m not sure what to do. I don’t want to use hinges because they will cause more lag in the game. So, I plan on used tweeting for doors, chests, lockboxes, safes, vaults, etc… If you have any info, it would be greatly appreciated and it’ll help a lot. Thanks!
Here’s also my script for the Tween:
local RS = game:GetService("ReplicatedStorage")
local RF = RS:WaitForChild("AlexDormRoom"):WaitForChild("LockBoxes"):WaitForChild("VaultzChest1")
local TS = game:GetService("TweenService")
--Functions--
RF.OnServerInvoke = function(player, codeEntered)
local MotorAxis = game.Workspace:WaitForChild("Alex's Room").VaultzLockChest.Motor
local goal = {}
goal.Orientation = Vector3.new(-75, -90, 0)
local tInfo = TweenInfo.new(
1.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
1,
false,
0
)
local tween = TS:Create(MotorAxis, tInfo, {Orientation = Vector3.new(-75, -90, 0)})
if codeEntered == '7264' then
tween:Play()
return true
else
return false
end
end