local plr=game.Players.LocalPlayerlocal cam=game.Workspace.CurrentCameralocal mouse=plr:GetMouse()cam.CameraType="Scriptable"cam.CameraSubject=game.Workspace
You are watching: Cube eat cube games

You can just execute this: cam.CoordinateFrame = CFrame.new(game.Workspace
1 answer
Log in come vote
0


Answered by



See more: The Beatles I Saw Her Standing There Bass Tab By The Beatles
5 years earlier
This is a suggestion of a different method to resolve it:
You might use camera.CoordinateFrame, i m sorry is basically transforming where the camera is positioned, and where that is looking. It supplies CFrame.E.G:
local cam = game.Workspace.CurrentCamera-- inserts a component to look atlocal part = Instance.new("Part",game.Workspace)part.Anchored = truepart.BrickColor = BrickColor.new("Really black")part.Position = Vector3.new(0,10,0)-- if loop to adjust where the camera is facingwhile wait() execute cam.CoordinateFrame = CFrame.new(game.Workspace.Baseplate.Position,part.Position)endCFrame worths basically go favor this:
Argument #1:
Vector3 value, position of the camera, in the manuscript above, it provides the position of the camera the exact same as Baseplate"s position.
Argument #2:
Vector3 value, what the camera is feather at, in the script above, that is looking at the black Part.
For much more info on CFrame: http://wiki.roblox.com/index.php/CFrame
When trying to be over a component that is moving, you require to have actually the very first argument the CoordinateFrame"s CFrame to be in the same position of the component that is moving, so you can always see it, and that it is in the center of the screen.Like so:
local ns = game.Workspace.TestPartp.Anchored = truelocal cam = game.Workspace.CurrentCamerawhile wait(.01) execute p.Position = p.Position + Vector3.new(0.01,0,0) -- move it ~ above the X axis. Cam.CoordinateFrame = CFrame.new(p.Position + Vector3.new(0,10,0),p.Position )endThis manuscript should relocate a part on the X axis every hundredth the a second, and also make the camera look in ~ the Part.Also, the factor I am including to the CoordinateFrame"s very first argument is since I want to watch the Part, no look at it while within the part (which is usually impossible).