I’m trying to implement ModuleScripts into my game to essentially streamline interactable objects, but for some reason whenever I tween with the ModuleScript the orientation, though using LookVector, is oddly set to (0,0,0).
Ex: https://gyazo.com/037faf34ed3e211a03f2ea807647d8b1
Here’s the ServerScript (Don’t mind the -1 multiplied by the look vector, it’s to simply flip it because I didn’t feel like rebuilding my dressers):
local CurrentStatus = Interaction:FindFirstChild("Status")
Drawer.Status = CurrentStatus.Value
Drawer.Part = Interaction
Drawer.TweenedPosition = CFrame.new(Interaction:FindFirstChild("OriginalPos").Value + (-1 *Interaction.CFrame.LookVector * 2))
Drawer.Position = CFrame.new(Interaction:FindFirstChild("OriginalPos").Value)
if Drawer.Status == false then
local CF = {
CFrame = Drawer.TweenedPosition
}
CurrentStatus.Value = true
Drawer:Open(Interaction,CF,CurrentStatus.Value)
else
local CF = {
CFrame = Drawer.Position
}
CurrentStatus.Value = false
Drawer:Close(Interaction,CF,CurrentStatus.Value)
end
And here’s the modulescript:
function Interactables:Open(interacted,pos,state)
TweenService:Create(interacted,tweenInfo,pos):Play()
self.Status = state
end
function Interactables:Close(interacted,pos,state)
TweenService:Create(interacted,tweenInfo,pos):Play()
self.Status = state
end
I have absolutely no idea what I’m doing wrong. Any help?
Thanks!