|
| 11 Mar 2016 02:05 AM |
Assuming that any variables not defined in here are already defined can you explain to me why this no longer works?
local recoil = .04
function CamShake(time, freq) coroutine.resume(coroutine.create(function() local cam = game:GetService("Workspace").CurrentCamera local time = 15 local seed = Vector3.new(math.random(recoil*1000, recoil*2000) / freq, math.random(-recoil*750, recoil*750) / freq, 0) if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, seed.y, 0) end if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(seed.x * time, seed.y * time, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude) for i = 1, time do cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(-seed.x, -seed.y, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude) wait() end end)) end |
|
|
| Report Abuse |
|
| |
|
| 11 Mar 2016 09:24 AM |
If nobody has a decent answer, I've seen quite a few people saying their camera scripts no longer work, and a lot of camera stuff was broken or something. I think this may be one of the rare few times when it was actually Roblox's fault. Of course, if someone has a decent answer, that might not be the case.
Also, CoordinateFrame is deprecated now and you should use CFrame which was added to Camera recently.
|
|
|
| Report Abuse |
|
zaks06
|
  |
| Joined: 16 Dec 2013 |
| Total Posts: 35 |
|
|
| 11 Mar 2016 09:48 AM |
| If this script works, thanks, I can use it for my game C: |
|
|
| Report Abuse |
|
LTB4
|
  |
| Joined: 05 Mar 2016 |
| Total Posts: 298 |
|
|
| 11 Mar 2016 09:53 AM |
@zaks
Why would he ask for help if it does work?
#code --LTB4 |
|
|
| Report Abuse |
|