Hello, I am working on a FPS Framework and I need to shake the camera using the animation itself. The viewmodel has a “CamPart” which is welded to the PrimaryPart of the model(“HumanoidRootPart”). I have tried every other possible way of doing this but I can’t find it. I am not looking for entire scripts or frameworks, especially “EZ camera shake”, I have looked at it and did not find what I’m looking for. Please help me.
Try to find source codes of other fps engines.
How am I even supposed to do that?
ACS and CE uses camera shakes try to read their codes.
Can you link me to it please maybe the devforum posts?
Try to search toolbox for ACS by @00scorpion00 and CE search carbon engine plugin.
I think you can’t read codes of CE as they are obfuscation.
I can’t find a single thing in those mazes
I know that. Have u tried to see devhub about, Cframe
I have created my own module which uses the FakeCamera of the viewmodel. And looks like its exactly what you wanted. So here it is: https://create.roblox.com/store/asset/105777724049560/Camera-Animations-Module
But, you will have to use spring module for it to work.
Anyways heres how to run it:
-- for example, when equipping the gun:
ViewmodelBob.AnimateCamBob(Viewmodel)
-- when you fully unequip it:
ViewmodelBob.Disable()
If there are any issues let me know.
Edit: At the start of the module code, there is:
local fakeCamera = viewmodel:FindFirstChild("FakeCamera") or viewmodel.PrimaryPart or viewmodel:FindFirstChild("HumanoidRootPart")
if not fakeCamera then
warn("No valid fake camera found.")
return
end
If your fake camera is called CameraRig or something other than what the script expected, you can adjust it from the script. And you can remove the or viewmodel.PrimaryPart or viewmodel:FindFirstChild("HumanoidRootPart"), this was to make sure that even if there was no camera, it will use the rootpart of the viewmodel.
Also, you will have to adjust the spring module path from the camera animation script