local plr=game.Players.LocalPlayerlocal cam=game.Workroom.CurrentCameraneighborhood mouse=plr:GetMouse()cam.CameraType="Scriptable"electronic camera.CameraSubject=game.Workspace
You are watching: Cube eat cube games
You can simply execute this: cam.CoordinateFrame = CFrame.new(game.Workspace
Log in to vote
See more: The Beatles I Saw Her Standing There Bass Tab By The Beatles
5 years earlier
This is a tip of a different way to solve it:
You can use cam.CoordinateFrame, which is basically transforming wright here the electronic camera is positioned, and wright here it is looking. It provides CFrame.E.G:
neighborhood electronic camera = game.Workarea.CurrentCamera-- inserts a component to look atneighborhood part = Instance.new("Part",game.Workspace)component.Anchored = truecomponent.BrickColor = BrickColor.new("Really black")component.Position = Vector3.new(0,10,0)-- while loop to adjust wbelow the cam is facingwhile wait() execute camera.CoordinateFrame = CFrame.new(game.Workarea.Baseplate.Position,part.Position)endCFrame worths basically go favor this:
Vector3 worth, place of the electronic camera, in the script over, it makes the place of the camera the very same as Baseplate"s position.
Vector3 worth, what the video camera is looking at, in the script above, it is looking at the black Part.
For even more details on CFrame: http://wiki.roblox.com/index.php/CFrame
When trying to be above a component that is relocating, you should have the initially argument of CoordinateFrame"s CFrame to be in the same place of the part that is moving, so you can always view it, and also that it is in the center of the display screen.Like so:
regional p = game.Workroom.TestPartp.Anchored = truelocal video camera = game.Workspace.CurrentCamerawhile wait(.01) execute p.Position = p.Position + Vector3.new(0.01,0,0) -- moves it on the X axis. cam.CoordinateFrame = CFrame.new(p.Position + Vector3.new(0,10,0),p.Position )endThis manuscript need to move a Part on the X axis eextremely hundredth of a 2nd, and make the camera look at the Part.Also, the reason I am including to the CoordinateFrame"s initially argument is because I want to view the Part, not look at it while inside the Part (which is basically impossible).