generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Manipulating the Camera

Previous Thread :: Next Thread 
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
26 Oct 2013 06:29 PM
I'm working on a cut scene but I have very little experience with manipulating cameras. With help from the wiki, this is what I got:
--
player = script.Parent.Parent
cam = game.Workspace.CurrentCamera
cam.CameraType = "Scriptable"
cp = game.Workspace.CameraPart
pos = cp.Position
cam.CoordinateFrame = CFrame.new(pos)
cam.Focus = CFrame.new(game.Workspace.Base2.Position)
for i = 160, 1, -1 do
cp.CFrame = cp.CFrame - Vector3.new(1, 0, 0)
wait(.01)
end
wait(2)
for i = 160, 1, -1 do
cp.CFrame = cp.CFrame + Vector3.new(0, 0, 1)
wait(.1)
end
wait(2)
for i = 160, 1, -1 do
cp.CFrame = cp.CFrame + Vector3.new(1, 0, 0)
wait(.01)
end
wait(2)
for i = 160, 1, -1 do
cp.CFrame = cp.CFrame - Vector3.new(0, 0, 1)
wait(.01)
end
--
This is supposed to set the camera to Scriptable, and watch a part (game.Workspace.Base2) from the perspective of a part (game.Workspace.CameraPart or cp). Then it moves the part around the baseplate while the camera is still focused on the baseplate's center.
Instead, the camera looks straight forward from the brick's perspective. It doesn't focus on Base2 and it doesn't move around with the part. I think the issue is with the CameraType. What should I use instead of Scriptable?

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
26 Oct 2013 06:47 PM
Bump.

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Oct 2013 06:48 PM
* CFrame.new*'

Though I have not ever tested: "CFrame + Vector3"
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
26 Oct 2013 06:53 PM
@cnt
The problem isn't with the brick. It moves around just fine.

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
26 Oct 2013 07:01 PM
Bump 2.

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
26 Oct 2013 07:20 PM
No one knows?

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Oct 2013 07:23 PM
You want the camera to move or the part..?
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
26 Oct 2013 07:24 PM
1) You need to update the camera EVERY frame the Part moves, not just the once.
2) I don't think Focus works in Scriptable mode. Instead, use this line:

Camera.CoordinateFrame = CFrame.new(pos,game.Workspace.Base2.Position)

To point it at the part. Drop the Focus line.
Report Abuse
fireheart568 is not online. fireheart568
Joined: 04 Jan 2009
Total Posts: 1285
26 Oct 2013 07:24 PM
I've been trying to help, it keeps blocking me out claiming I've broken a rule. I'll PM my post to you.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image