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

Previous Thread :: Next Thread 
Dark_Messiah is online. Dark_Messiah
Joined: 07 May 2008
Total Posts: 221
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
Dark_Messiah is online. Dark_Messiah
Joined: 07 May 2008
Total Posts: 221
11 Mar 2016 09:08 AM
bumpity
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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 is not online. 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 is not online. 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
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