I’m working on a shop where you press left or right to move across the items. Yet when I move the camera, it goes to the right position but moves to a completely different angle. This might be a simple fix but I’m stupid and couldn’t find anything lol.
Gif of issue: https://gyazo.com/bcc3f9ad950df82c6ab84340ec5b98f9
Code snippet which controls this (sorry for messy trash code)
(Lobby_Shop.Camera is the part the workspace camera is tweened to)
UserInputService.InputBegan:Connect(function(Input, GameProccess)
if not GameProccess and Shop.Enabled == true then
if Input.UserInputType == Enum.UserInputType.Keyboard then
if Input.KeyCode == Enum.KeyCode.A or Input.KeyCode == Enum.KeyCode.Left then
if Selection ~= 1 then
Selection -= 1
Configure()
local PartCameraTween = TweenService:Create(Lobby_Shop.Camera, TweenInfo.new(0.5), {Position = Vector3.new(Lobby_Shop.Camera.Position.X, Lobby_Shop.Camera.Position.Y, Lobby_Shop.Camera.Position.Z - 6)})
local CameraTween = TweenService:Create(Camera,TweenInfo.new(0.5),{CFrame = CFrame.new(Lobby_Shop.Camera.Position.X, Lobby_Shop.Camera.Position.Y, Lobby_Shop.Camera.Position.Z - 6)})
PartCameraTween:Play()
CameraTween:Play()
end
elseif Input.KeyCode == Enum.KeyCode.D or Input.KeyCode == Enum.KeyCode.Right then
if Selection ~= SelectionMax then
Selection += 1
Configure()
local PartCameraTween = TweenService:Create(Lobby_Shop.Camera, TweenInfo.new(0.5), {Position = Vector3.new(Lobby_Shop.Camera.Position.X , Lobby_Shop.Camera.Position.Y, Lobby_Shop.Camera.Position.Z + 6)})
local CameraTween = TweenService:Create(Camera,TweenInfo.new(0.5),{CFrame = CFrame.new(Lobby_Shop.Camera.Position.X, Lobby_Shop.Camera.Position.Y, Lobby_Shop.Camera.Position.Z + 6)})
PartCameraTween:Play()
CameraTween:Play()
end
end
end
end
end)
