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 Interpolation

Previous Thread :: Next Thread 
Ryuzoji is not online. Ryuzoji
Joined: 21 Dec 2015
Total Posts: 937
12 Nov 2016 06:09 PM
local Emitter = game.Workspace.Emitter
local Camera = game.Workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = Emitter
local WaitTime = 5

function RandomRotation()
local x = math.rad(math.random(-360, 360))
local y = math.rad(math.random(-360, 360))
local z = math.rad(math.random(-360, 360))
return x, y, z
end

while wait() do
WaitTime = math.random(5, 10)
Camera:Interpolate(Camera.CoordinateFrame, CFrame.new(Emitter.Position + Vector3.new(0, 0, math.random(30, 50))) * CFrame.Angles(RandomRotation()), WaitTime)
wait(WaitTime)
end

--------------------------------------------------------

I haven't scripted in a while so go easy on me.
I have this small brick in my Workspace and I want the camera to rotate around the brick in a random direction for a certain amount of time before looping. Problem is, I see the brick but the camera is INSIDE the brick, then moving out the screen and never showing up. Any fixes?
Report Abuse
Ryuzoji is not online. Ryuzoji
Joined: 21 Dec 2015
Total Posts: 937
12 Nov 2016 06:19 PM
Ignore that script ^
---------------
local Emitter = game.Workspace.Emitter
local Camera = game.Workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = Emitter
Camera.Focus = CFrame.new(Emitter.Position)
local WaitTime = 5

function RandomRotation()
local x = math.rad(math.random(-180, 180))
local y = math.rad(math.random(-180, 180))
local z = 0
return x, y, z
end

while wait() do
WaitTime = math.random(5, 10)
Camera:Interpolate(CFrame.new(Emitter.Position + Vector3.new(0, 0, math.random(30, 50))) * CFrame.Angles(RandomRotation()), Camera.Focus, WaitTime)
wait(WaitTime)
end
--------------------

I see the brick, the problem is that the brick does NOT stay at the center of the screen.
Report Abuse
darknight189517 is online. darknight189517
Joined: 27 Dec 2013
Total Posts: 1855
12 Nov 2016 06:22 PM
what you mean by that its is in the block should it be in the block and were is the the script what script is it local or an regular script
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