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 » Scripting Helpers
Home Search
 

Re: How to I make the screen shake

Previous Thread :: Next Thread 
SpecterSlash is not online. SpecterSlash
Joined: 29 Aug 2009
Total Posts: 629
23 Sep 2014 06:30 AM
Im making a script about guns. I already finished the shooting and stuff but how do i give the gun a recoil effect like your screen will shake up?
Report Abuse
jacklollz2 is not online. jacklollz2
Joined: 08 Oct 2010
Total Posts: 1183
23 Sep 2014 06:31 AM
http://wiki.roblox.com/index.php?title=API:Class/Camera
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
23 Sep 2014 07:58 AM
I do not have so much experience with camera, although, I believe you want to use the SetRoll method.
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
23 Sep 2014 07:58 AM
Camera.CoordinateFrame
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
23 Sep 2014 08:00 AM
^ According to wiki that changes the CFrame of it not the rotation of it? :P
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
23 Sep 2014 08:01 AM
You can make the screen shake by changing it, I've done it.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
23 Sep 2014 08:02 AM
Ooo nice. I personally think it's to much to the camera on the wiki..

I mean, some things is no point having because you can just choose using others..
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
23 Sep 2014 08:12 AM
wait()
local Player = game.Players.LocalPlayer
local Camera = workspace.CurrentCamera
local RunServ = game:GetService("RunService")

RunServ.Heartbeat:connect(function()
Camera.CoordinateFrame = Camera.CoordinateFrame * CFrame.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1))
end)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
23 Sep 2014 08:24 AM
@Ny

wouldn't you need to use CFrame.Angles to rotate the camera with it?
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
23 Sep 2014 08:27 AM
No. CFrame.new() with the CoordinateFrame changes the rotation.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
23 Sep 2014 08:28 AM
Oh, what happens if you do the CFrame.new() with Angles then?
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
23 Sep 2014 08:28 AM
I tried CFrame.Angles before CFrame.new and it did nothing.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
23 Sep 2014 08:29 AM
Ah okay, i'll use CFrame of the camera * CFrame.new() then.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
23 Sep 2014 08:30 AM
Also another not so ontopic question,

Camera.CoordinateFrame = Camera.CoordinateFrame * CFrame.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1))
end)


Can you do

Camera.CoordinateFrame = Camera.CoordinateFrame + CFrame.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1))
end)


I mean, is * the same as + in this case?
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
23 Sep 2014 08:32 AM
the plus and minus symbols are for Vectors, they won't work with CFrame.

If you use it with CFrame you get something like:

bad argument #2 to '?' (Vector3 expected, got userdata)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
23 Sep 2014 08:35 AM
Wow really!? That was actually very helpful because I swear I sometime in the future would have used pluss and minus for CFrame. Thanks pal :-)
Report Abuse
anaIyze is not online. anaIyze
Joined: 29 May 2014
Total Posts: 2048
23 Sep 2014 12:11 PM
+ = addition
- = subtraction
/ = division
* = multiplication


Report Abuse
PlumJar is not online. PlumJar
Joined: 04 Mar 2012
Total Posts: 907
23 Sep 2014 12:13 PM
^lol man ur so smart i wish i was like u, analyze


Mewo.
Report Abuse
anaIyze is not online. anaIyze
Joined: 29 May 2014
Total Posts: 2048
23 Sep 2014 12:17 PM
Also, if you want to make your camera shake, I would suggest interpolating it with CFrame manually
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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