How do you think to make the camera stay in the resulting CFrame when the player is not moving? If anything, the player can rotate the camera freely, but the camera must keep the CFrame received when the player stopped. Who doesn’t understand, it should look like in SCP: Containment Breach.
RNS.RenderStepped:Connect(function()
local velocity = math.round(Vector3.new(HRP.AssemblyLinearVelocity.X, 0, HRP.AssemblyLinearVelocity.Z).Magnitude)
if velocity > 2 then
camera.CFrame *= CFrame.new(0, GetCurve(verFrequency, verIntensity) * velocity / defWalkSpeed, 0) * CFrame.Angles(0, 0, math.rad(GetCurve(rotFrequency, rotIntensity) * velocity / defWalkSpeed))
InitialVelocity = velocity
elseif velocity <= 0 then
camera.CFrame = ???
end
end)
You don’t understand. Everything works great. However, I need to achieve that when the player stops, the camera remains in the same position as it was while walking, while the player can move it. The video at the end especially shows this.
What can’t you understand? It is necessary to make sure that the camera remains in the same CFrame, but the player could move the camera, that is, the Z orientation remained at the same value (there was the same tilt of the camera when there was the last movement), but the player could rotate the camera freely.
I’d suggest making the Character platformstand by setting PlatformStand in the Humanoid of the character to true.
That makes the player unable to move but still free to look around and rotate however they want to.
Sorry, but this is not the right solution. Here only the player will stop and be able to rotate the camera. I need to make the camera partially freeze in the last orientation (which is obtained when walking), but the player could rotate the camera. The problem is that the camera changes the CFrame to a regular CFrame.
After using your code, the camera will still not remain in the CFrame that I got from walking. Camera’s CFrame becomes a CFrame, as if it were without the influence of Camera Bobbing.
The problem is that it is multiplied by one, so to speak, that is, every time RenderStepped is performed, the camera multiplies its CFrame by the resulting CFrame from the formula, and each change is quite small.
And I also noticed that the camera’s CFrame seems to start over, which may now be the main problem that needs to be solved. Therefore, it is necessary to use something else, but now more related to this problem.