Quantcast

Help, topic: Camera

My body compels me to please my eyes with an euphoria of your exquisite answers.

But seriously… I really need help. I need a script that makes the map 2D when touching a block and disables it when you touch another block.

The script has to be scrolling up vertically
because the horizontal sides are only 1 screen.

Confusion.

It’s camera manipulation
Not sure how to do it but there are tutorials on the forums
Search like scripting help by kris or something

2 Likes

This is a hard topic for beginner scripters to understand, but if you have at least some scripting knowledge, this could work out for you. In your local event script, have this code (I have put in a bunch of variables for you to change)

--Vertical camera scrolling script by jacys23

--Change these variables:
local Xpos = 0
local Zpos = 0
local Xface = 1
local Zface = 0
local Yoffset = 0
local startname = "CameraStart"
local endname = "CameraEnd"
---------------------------
---------------------------

local rs = game:GetService("RunService")
local defaulttype = workspace.Camera.CameraType
local running = false
local char = game.Players.LocalPlayer.Character
char.Humanoid.Touched:Connect(function(hit)
if hit.Name==startname and not running then
running = true
workspace.Camera.CameraType = Enum.CameraType.Scriptable
rs:BindToRenderStep("pizza",1,function()
workspace.Camera.CFrame = CFrame.new(Vector3.new(Xpos,char.Head.Position.Y+Yoffset,Zpos),Vector3.new(Xface,char.Head.Position.Y+Yoffset,Zface))
end)
elseif hit.Name==endname and running then
running = false
rs:UnbindFromRenderStep("pizza")
workspace.Camera.CameraType = defaulttype
end
end)

The Xpos and Zpos indicate where you want your camera’s position to be, the Xface and Zface indicate the position you want your camera to point at, the Yoffset is the offset of the height. The part that you want to start the vertical scrolling must be named the same as startname, and the part you want to end it must be named the same as endname. You can have multiple start and end parts. To find the position you want, make a pole you would want the camera to scroll up and down on and copy the x and z positions. To find the position you want the camera to face, copy that pole and place it slightly in front and copy the x and z positions. Then remove the poles.

1 Like

Thanks :heart_eyes: You’re a life saver!!111!

I hate unformatted code bruh :frowning:

1 Like

Yes I know, every time I make a script in the team create you make me stop editing just so you can indent it :unamused:

Sorry, I’ll stop that lol

1 Like