I have a viewmodel that basically needs to be rotated when u start aiming because when u are hip firing it is angled, and I want to rotate the viewmodel somehow, not the camera, how would I do that?
3 Likes
Best way is with an animation if u want to achieve this, or rotate the hands themselves
I need another way, not an animation because it would mean rescripting my reload, inspect and some other stuff
You can use CFrame.Angles(x,y, z).
1 Like
Literally ViewportFrame.Rotation.
Use math.rad() as well
1 Like
Thats not a viewmodel however hes on about the better way sticking to camera
Ah I see, I read ViewportFrame instead ViewportModel. Yeah, CFrame.Angles should be used.
CFramePosition * CFrameRotation * ExtraRotation
Tried, it didn’t work, the code was something like:
vm:PivotTo(cam.CFrame * offset * CFrame.Angles(0,math.rad(45), 0) * recoil
vm:PivotTo(
cam.CFrame * MainCF * AimCF * CFrame.Angles(0, math.rad(69), 0) * CFrame.Angles(math.rad(-SwayY),math.rad(-SwayX),0)
)
Doesn’t work.