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 » Scripters
Home Search
 

Re: Camera Manipulation | Please Help!

Previous Thread :: Next Thread 
thebootsie123 is not online. thebootsie123
Joined: 20 Jul 2014
Total Posts: 142
17 Jul 2016 10:57 AM
I'm trying to make a script that has the camera rotate around the part. When you rotate you are rotating around the part and not basically first person in the part. I was wondering how I would do this. Here is my script so far although it doesn't really do what I want it to.

local target = game.Workspace.Plot.Plot
local Camera = game.Workspace.CurrentCamera

Camera.CameraSubject = target
Camera.CameraType = "Scriptable"

local angle = 0

while wait() do
Camera.CoordinateFrame = CFrame.new(target.Position) * CFrame.Angles(0,angle,0)
angle = angle + math.rad(1)
end



Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
17 Jul 2016 11:04 AM
you'd need to do something like theees.

local target = workspace.Plot.Plot
local cam = workspace.CurrentCamera

cam.CameraSubject = target
cam.CameraType = "Scriptable"

local angle = 0
local speed = 50

while true do
angle=angle+(game:GetService("RunService").RenderStepped:wait()*speed)
cam.CFrame = target.CFrame * CFrame.Angles(0,math.rad(angle),0) * CFrame.new(0,0,10)
end
Report Abuse
thebootsie123 is not online. thebootsie123
Joined: 20 Jul 2014
Total Posts: 142
17 Jul 2016 11:11 AM
Is there a way to make it rotate around a part? So the camera is going around the part although the camera is pointed at the part?


Report Abuse
thebootsie123 is not online. thebootsie123
Joined: 20 Jul 2014
Total Posts: 142
17 Jul 2016 11:15 AM
So, can someone help me?


Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
17 Jul 2016 11:42 AM
my script does that...
Report Abuse
thebootsie123 is not online. thebootsie123
Joined: 20 Jul 2014
Total Posts: 142
17 Jul 2016 11:43 AM
What your script does is makes the camera go around a part but does not look at the part. What I want is a script that goes in a circle around a part and looking at it sort of like a 3rd person 360 shot.


Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
17 Jul 2016 11:46 AM
It does look at the part. That's what i've tested.

Is the part you're targetting too big? then just increase the "10" to whatever larger size you want it to be.
Report Abuse
thebootsie123 is not online. thebootsie123
Joined: 20 Jul 2014
Total Posts: 142
17 Jul 2016 11:50 AM
Nevermind. It works. Thank you. Is there a way I can tilt the camera?


Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
17 Jul 2016 11:52 AM
Yes in CFrame.Angles just change the 0s in there. It'll affect the angle of the camera starting out.
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
17 Jul 2016 11:54 AM
@Speedy

There's a function now that can smoothly tween camera movement and rotation.

void
Interpolate ( CFrame endPos, CFrame endFocus, float duration )

A friend actually told me about this :P.
Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
17 Jul 2016 11:55 AM
@secret6timb1 I already know about that function, but there was a lot of troubles back in the day regarding its 'functionality' so I just code it all myself.
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
17 Jul 2016 11:57 AM
Ah, Lel, 'Function', 'Functionality', play on words.

Actually going to save this forum or part's of it in-case I run into problems in the future.
Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
17 Jul 2016 12:00 PM
Yes not too long ago the Interpolation was completely broken and didn't work for anybody. I ended up having to create my own function with workspace.CurrentCamera.CFrame:lerp(cf2) in it.

And now I just don't trust it.
Report Abuse
TheGrayHat is not online. TheGrayHat
Joined: 02 May 2014
Total Posts: 523
17 Jul 2016 12:04 PM
"Ah, Lel, 'Function', 'Functionality', play on words."

Not really, it's just the proper word to use in that situation.

I haven't tried that function recently, but it used to not be implemented.
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
17 Jul 2016 12:07 PM
@TheGray

You're no fun :c.

I haven't used any camera interpolation yet.

I'll just use whichever is most optimal when I get to it.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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