|
| 06 Apr 2013 10:55 AM |
| Would I just attach the camera to a part and move the part by CFrame? |
|
|
| Report Abuse |
|
|
getkoed2
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 1144 |
|
|
| 06 Apr 2013 11:15 AM |
| I guess you could set the CameraSubject to that part, then change the CoordinateFrame to your likings and make the CameraType Scriptable. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 11:16 AM |
| This would be the equivalent of moving the Camera by CFrame. You could use BodyPosition/BodyVelocity for smoother Camera movement. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 11:19 AM |
| Oh wait, I just found out the Method "Interpolate", going to find a tutorial on dat. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 11:20 AM |
| Dang it they dun haz any tutorials on it. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 11:24 AM |
| Linear interpolation. Used by vectors. It still doesn't solve the jerkyness of the Camera. The only way you can do this is if you move the camera slowly (by around 0.01 units per cycle). |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Apr 2013 11:28 AM |
Lol k since I'm to lazy to figure out what the 2nd argument of interpolation then Ima go try Camera CFraming.
Lol joo can manipulate Camera with Body Objects? |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 11:33 AM |
No.
The second argument is a percentage value. That's all. 1 is 100%. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 11:40 AM |
| Oh, k I have officially learned CoordinateFrame, now how would I do the math to get it to do that? |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 12:52 PM |
Oh wait, I just realized I could +/- the X value until it matches with the other X value, then do the same thing with Z value.
|
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 01:13 PM |
Ok I finally did it, but its faulty and makes the camera jerky (not the full script!):
local Player = script.Parent.Parent
function onKeyDown(key) elseif key == "r" then local cam = game.Workspace.CurrentCamera local p = game.Workspace.SpawnLocation.Position local a = cam.CoordinateFrame print(cam.CameraType) cam.CameraType = "Scriptable" while cam.CoordinateFrame ~= p do wait(0.1) if a.X - p.X < 0 then wait(0.1) cam.CoordinateFrame = CFrame.new(a.X + 0.1,a.Y,a.Z) elseif a.X - p.X > 0 then wait(0.1) cam.CoordinateFrame = CFrame.new(a.X - 0.1,a.Y,a.Z) elseif a.Z - p.Z < 0 then wait(0.1) cam.CoordinateFrame = CFrame.new(a.X,a.Y,a.Z + 0.1) elseif a.Z - p.Z > 0 then cam.CoordinateFrame = CFrame.new(a.X,a.Y,a.Z - 0.1) end end
function onKeyUp(key) elseif key == "r" then local pos = script.Parent.Parent.Character.Head.Position local cam = game.Workspace.CurrentCamera cam.CoordinateFrame = CFrame.new(pos.X,pos.Y,pos.Z) cam.CameraType = "Custom" end
local Mouse = Player:GetMouse() Mouse.KeyDown:connect(onKeyDown) Mouse.KeyUp:connect(onKeyUp)
|
|
|
| Report Abuse |
|
|