so i have a code when u put ur mouse over a book the book z axis change by 2
but the y also change tho i didnt make a code that change the y axis
Intrect.Triggered:Connect(function()
PlayerCamera.CameraType = Enum.CameraType.Scriptable
toggleHide(1)
TweenService:Create(PlayerCamera,CameraTween,{CFrame = CameraHere.CFrame}):Play()
local LastTarget = nil
PlayerMouse.Move:Connect(function()
local Target =PlayerMouse.Target
if Target then
if Target.Parent.Name == "Book" and Target.Parent ~= LastTarget then
print(Target,LastTarget)
LastTarget = Target.Parent
local CFrameVAL = Instance.new("IntValue")
local TargetPosition = Target.Parent:GetPivot().Position
CFrameVAL.Value = 0
CFrameVAL:GetPropertyChangedSignal("Value"):Connect(function()
Target.Parent:MoveTo(TargetPosition - Vector3.new(0,0,CFrameVAL.Value))
print(CFrameVAL.Value,Target.Position )
end)
TweenService:Create(CFrameVAL,CameraTween,{Value = 2}):Play()
--z - 2
end
end
end)
end)