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 Shaking

Previous Thread :: Next Thread 
HamilcarMago is not online. HamilcarMago
Joined: 11 Jul 2010
Total Posts: 1094
22 Jul 2015 07:14 PM
How can I shake someone's camera.

I've tried

camera.CoordinateFrame =camera.CoordinateFrame*CFrame.new(number,number,number)

But that doesn't work.
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
22 Jul 2015 07:17 PM
SetRoll maybe?

it'd help you shake the camera side to side

http://wiki.roblox.com/index.php?title=SetRoll
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
22 Jul 2015 07:24 PM
To make the camera shake, you have to understand tweening and lerping.
Make a random number in an xyz. This will be a distance vector, not a point vector.
Lerp to the point fast.
You will then lerp back to the spot.

Alternatively you can make a direction vector and lerp that direction for a random number.
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
22 Jul 2015 07:26 PM
"To make the camera shake, you have to understand tweening and lerping."
ahahahah
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
22 Jul 2015 07:35 PM
If you don't mind using code directly, here's something I made to make the camera bounce vertically.

local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Shaking = false
local Increment = 10
local Delta = 0.1

Humanoid.Running:connect(function(Speed)
Speed = math.floor(Speed + 0.5)
if Shaking and Speed > 0 then
return
end
if Speed > 0 then
Shaking = true
local v = 0
game:GetService("RunService"):BindToRenderStep("ShakeCamera", 1, function()
v = v + Increment
Camera.CoordinateFrame = Camera.CoordinateFrame * CFrame.fromAxisAngle(
Vector3.new(1, 0, 0),
math.rad(Delta * math.sin(Humanoid.WalkSpeed * 0.75 * tick()))
)
end)
else
Shaking = false
game:GetService("RunService"):UnbindFromRenderStep("ShakeCamera")
end
end)
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
22 Jul 2015 07:38 PM
@funese
I meant tweening or lerping...
but why the ahahahaha?
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