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
|
  |
| 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 |
|
|
|
| 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 |
|
|