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:

1 Like

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

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