Hi all. I’ve recently been working on commission for a project that wants to be fully first-person, however I’m not sure how I should go about making the sway for the view-model. I know it’s been done before, but I haven’t the faintest idea where to start. All I’ve really done is make the view-model’s CFrame follow the camera.
This is the sort of thing I’m trying to create, instead of it just following the camera, it has that slight drag to it as you move it.
Hope I explained this well, not the best at this.
1 Like
If you’re trying to make the model move slightly delayed or a little smoother, use CFrame lerping on the model.
If you’d like to make it go a bit further than the cam, as visible in the video clip, make a function bound to render step calculating the difference from the camera CFrame of the previous frame and the current camera CFrame (Previous frame variable must be updated after calculating difference and before updating CFrame) and translate the model by difference’s position in global space (base CFrame + difference.p (Preferrably divide by 5 or so)) and difference’s rotation in local space (base CFrame * (difference - difference.p)).
Or try translating it by difference’s rotation in y-axis along the local x-axis of the camera and by difference’s x-rotation along the local y-axis, that will probably get the closest to the sample video.
Hope this helps.
7 Likes
Works like a charm. Thanks for the help!
1 Like