Need help on some cframes

Hello Everyone, I need some help with a gun ViewModel I am making. I am trying to make an aim part and when try it worked put the position of your camera goes somewhere else. Any help.

my script now

local aim = script.Parent.Aim.CFrame:inverse() * script.Parent.Handle.CFrame;
return aim * CFrame.Angles(0,math.rad(0),0)

reminder: all the script to make the aim part is done. just need help on the cframe part

1 Like

You get your aim CFrame, but how are you using it?

EDIT: Are you trying to move the arms/gun or the camera?

I am trying to move the camera

Maybe your Handle Position is offset?
Have a look at where the Handle is compared to the gun’s sights. In the video it seems like your camera is moving forward a stud or two and the gun appears to be passed by in your peripheral vision. Get the gun model and select just the Handle to see where it is aligned to the entire gun.
Why aren’t you just using local aim = script.Parent.Handle.CFrame?
Also why are you returning aim multiplied by 0,0,0 in the second line?

I have tried everything, the handle is on the gun’s trigger and I change the script and still, nothing has worked.

Do you set Handle.CFrame to that aim CFrame?
Because you keep doing script.Parent.Aim.CFrame:inverse * script.Parent.Handle.CFrame

If you’re trying to move the camera, why does the arms move? In the video, it looks more like you’re changing the FOV rather than moving the camera.

So I got it to work because of some help for Ninja_Deer, which I found that it’s not the cam, its the gun its self so now the script I am using is

return CFrame.new(0,0,0)

thank you to all of yall