|
| 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 |
|
|
|
| 23 Sep 2014 06:31 AM |
| http://wiki.roblox.com/index.php?title=API:Class/Camera |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 15 Nov 2012 |
| Total Posts: 3374 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 29 May 2014 |
| Total Posts: 2048 |
|
|
| 23 Sep 2014 12:11 PM |
+ = addition - = subtraction / = division * = multiplication
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|