|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 22 Jul 2015 07:38 PM |
@funese I meant tweening or lerping... but why the ahahahaha? |
|
|
| Report Abuse |
|
|