I wanted to make smooth shift lock transition and made it removing the mouselock camera offset change in core script.
When i make own smooth shiftlock in local script using camera offset and start to jump backwards character stars to shake.
The local script which changes the offset if needed:
UIS:GetPropertyChangedSignal("MouseBehavior"):Connect(function()
if cameraModule.activeMouseLockController:GetIsMouseLocked() then
TweenService:Create(humanoid, TweenInfo.new(0.3, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out), {CameraOffset = Vector3.new(1.75, 0, 0)}):Play()
MouseLockPosition = Vector3.new(1.75)
else
TweenService:Create(humanoid, TweenInfo.new(0.3, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out), {CameraOffset = Vector3.new(0, 0, 0)}):Play()
MouseLockPosition = Vector3.new(0)
end
end)
I tried to make the smooth transition with editing the core script, and made this:
function BaseCamera:SetMouseLockOffset(offsetVector)
for i = 0, 1, 0.01 do
self.mouseLockOffset = self.mouseLockOffset:Lerp(Vector3.new(1.75, 0, 0), i)
task.wait(0.01)
end
end
But it works only first time when you use and after works like basic shiftlock does.
Thats all what i can say, ill be glad if someone would help me in solving the problem!