How to add camera movement for an animation

basically trying to do this: How do I simulate "weighty" gun reloads by manipulating the camera?

At the end of this post he concluded that ppl doing this had “baked the camera on blender” ?? ive been doing tons of research but didn’t find anything. The last hope i had was adding a camera on moon animator and linking it to the head and moving the head but when i exported the rig and published it on roblox the animation didn’t work.

image

Hi!
if you wanna add an animation to the players camera, make a localscript and put it in the players backpack. (this is just preference, you can put the localscript wherever as long as its in a local space. (StarterPlayerScripts, StarterGUI)

Since Moon Animator doesn’t directly animate the camera, you need to animate a proxy part (like the CamShakePart) instead. Here’s how:

  1. Add a new invisible part to your rig
  • Name it “CamShakePart” (or whatever you want).
  • Place it near the head or where you want the camera to be.
  • Attach it to the head using a Motor6D
  1. Animate this part in Moon Animator
  • Instead of animating the camera directly, animate this part.
  • Make it move and rotate like you want the camera to behave during reloads.
  1. Export and Play in Roblox
  • When you import your animation in Roblox, the CamShakePart should move exactly as animated.
  • Then use the script to set the player’s camera to follow this part.

I have made a short snippet that achieves this

local camShakePart = Instance.new("Part")
camShakePart.Transparency = 1
camShakePart.CanCollide = false
camShakePart.CanQuery = false
camShakePart.CanTouch = false
camShakePart.Size = Vector3.new()
camShakePart.Massless = true
camShakePart.CFrame = CFrame.new(head.Position)
camShakePart.Name = "CamShakePart"

local csm = Instance.new("Motor6D")
csm.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
csm.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
csm.Part0 = hrp
csm.Part1 = camShakePart
csm.Parent = camShakePart

camShakePart.Parent = hrp

Hope this helps :slight_smile:

2 Likes

i will test this asap, but dont i have to attach the part to the camera directly instead of the head ? ty for ur response

1 Like

Nope, Just attach it to the HRP (humanoidrootpart)

What you can do with the camera is when the player is in first person, you can match the cameras CFrame with the CamshakePart. I should of mentioned that before, i guess i forgot xd

1 Like

I think it requires this, maybe this is what you are seaching for ?

You would need the camera follow the Viewmodel camera angles, then animate the viewmodel , you don’t need a viewmodel for every tool, just a invisible viewmodel with the camera part on it, and then rig it, play the camera animations on the viewmodel

1 Like

meh not working

local script

local char = plr.Character
local rs = game:GetService("RunService")
local cam = workspace.Camera

local camShakePart = Instance.new("Part")
camShakePart.Transparency = 1
camShakePart.CanCollide = false
camShakePart.CanQuery = false
camShakePart.CanTouch = false
camShakePart.Size = Vector3.new()
camShakePart.Massless = true
camShakePart.CFrame = CFrame.new(char.Head.Position)
camShakePart.Name = "CamShakePart"
camShakePart.Parent = char:FindFirstChild("HumanoidRootPart")

local csm = Instance.new("Motor6D")
csm.Part0 = char:FindFirstChild("HumanoidRootPart")
csm.Part1 = camShakePart
csm.Parent = camShakePart

here i check when the player is in fps and when he is i did:

camera.CFrame = camera.CFrame * character:FindFirstChild("HumanoidRootPart").CamShakePart.CFrame

the camera is just going crazy

1 Like

problem is idk anything about viewmodel idek how i would even incorporate vm

1 Like