yeah how do i do this?
I’m not sure if your talking about the camera movement or the shop itself. For the camera movement though, you would need to create a gui with the buttons and then do something like this:
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local gui = player.PlayerGui:WaitForChild("CustomGui")
local left = gui.Left
local right = gui.Right
local customCamEnabled = false
local customCamPosition, customCamMax = 0, 2
local camParts = workspace.CamParts
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.T then
customCamEnabled = not customCamEnabled
gui.Enabled = not gui.Enabled
if customCamEnabled then
camera.CameraType = Enum.CameraType.Scriptable
customCamPosition = 0
camera.CFrame = camParts:FindFirstChild("Part0").CFrame
else
camera.CameraType = Enum.CameraType.Custom
customCamPosition = 0
end
end
end)
left.MouseButton1Click:Connect(function()
if customCamPosition > 0 then
customCamPosition -= 1
camera.CFrame = camParts:FindFirstChild("Part"..customCamPosition).CFrame
end
end)
right.MouseButton1Click:Connect(function()
if customCamPosition < customCamMax then
customCamPosition += 1
camera.CFrame = camParts:FindFirstChild("Part"..customCamPosition).CFrame
end
end)
This uses the player pressing T to toggle the custom camera, and uses a gui with two butttons (left and right) as the left and right variables. There is also a folder in the workspace with all of the parts signifying the camera’s positions in order.
Edit: keep in mind this doesn’t have any transition between the camera parts, it just moves between the parts instantly.
hey,
this script works but when i press “t” my left and right button dissapear
Do not, ever just ask for some code. This is Scripting Support, you are supposed to be supported by getting help with pre-existing code. If you don’t know how to do certain things, sure you can ask for help but provide previous attempts and be more specific. This is not a site where you ask and recieve code, it’s where you ask and recieve help. Two fundamentally different things.
? i didnt ask for code he could have sent me a tutorial or a documention explaining how, instead he straight up gave me the code i didnt ask for it in any way
You didn’t provide previous attempts at it either, you’re just flat out asking for direct explanations without any key information whatsoever.
how could i give previous attempts if i literally have no idea how to code what im asking? give me maybe a sample and i build off of it. this is a site where u get help right?
In your post, you could firstly provide more details on what you are working on. The video is good, but not sure what you are asking.
Mr_Spokes seems nailed it that you want a Camera that change its position to watch some objects.
You tried the script, seems that is not working as expected. Analyze what is done in that script and extract useful lines of code that are close to the behavior you desire and experiment with that.
Get back to forum, explain what you tried and we’ll be happy to help
Hello,
after a bit of coding from what i was given like you said i managed to get this
my code is not entirely finished
local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local gui = player.PlayerGui:WaitForChild("CustomGui")
local left = gui.Left
local right = gui.Right
local customCamEnabled = false
local customCamPosition, customCamMax = 0, 3
local camParts = workspace.CamParts
local triggerpart = workspace:WaitForChild('map'):WaitForChild('Shop').ShopTrigger
left.MouseButton1Click:Connect(function()
if customCamPosition > 0 then
customCamPosition -= 1
camera.CameraType = "Scriptable"
print(camParts:FindFirstChild("Part"..customCamPosition))
camera.CFrame = camParts:FindFirstChild("Part"..customCamPosition).CFrame
end
end)
right.MouseButton1Click:Connect(function()
if customCamPosition < customCamMax then
customCamPosition += 1
camera.CameraType = "Scriptable"
print(camParts:FindFirstChild("Part"..customCamPosition))
camera.CFrame = camParts:FindFirstChild("Part"..customCamPosition).CFrame
end
end)
but this seems good
ty
Its looking good! you got in the right track. Some camera tweening, fx, and you got a fancy shop. You made it work pretty quick! Happy coding!