so i am pretty sure this bug is related with the new roblox updates, but i cant post in the bug reports category so ill post here.
so basically whenever i turn on an fps unlocker and minimize my game, the viewmodel just disappears. this could be a pretty big problem since a lot of roblox users use an fps unlocker, especially in shooter games like mine.
this only started happening recently after the new updates, and the viewmodel script doesnt give me any errors in the console. it doesnt seem to happen without an fps unlocker.
1 Like
That’s because of DeltaTime if you’re using RunService.RenderStepped .
possible. how would i fix it then?
1 Like
Can you show me the script? So I can help.
Do you have like recoil that animates the viewmodel. That may causing it.
local MovementSwayAmount = Vector3.new(GetBobbing(10, 1, 0.2), GetBobbing(5, 1, 0.2), GetBobbing(5, 1, 0.2))
MovementSway.Velocity += ((MovementSwayAmount / 25) * DT * 90 * hrp.AssemblyLinearVelocity.Magnitude)*(DT/base)*(base/DT)
only thing that i can think of. dt is delta time, base is 1/60 and movementsway is a spring (im using a spring module)
I recommend you to use Springs instead of Velocity.
Here’s one you can use. There’s API in it.
--[=[
A physical model of a spring, useful in many applications.
A spring is an object that will compute based upon Hooke's law. Properties only evaluate
upon index making this model good for lazy applications.
```lua
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local spring = Spring.new(Vector3.new(0, 0, 0))
RunService.RenderStepped:Connect(function()
if UserInputService:IsKeyDown(Enum.KeyCode.W) then
spring.Target = Vector3.new(0, 0, 1)
else
spring.Target = Vector3.new(0, 0, 0)
end
print(spring.Position) -- A smoothed out version of the input keycode W
This file has been truncated. show original
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function(DeltaTime)
local MouseDelta = UserInputService:GetMouseDelta()
MovementSway.Target = Vector2.new((MouseDelta.Y / 100), (MouseDelta.X / 100))
VMHumanoidRootPart.CFrame = Camera.CFrame * CFrame.new(0, -1.5, 0) * CFrame.Angles(MovementSway.Position.X, MovementSway.Position.Y, -MovementSway.Position.X)
end)
Try this. I’m sure it will work. It doesn’t use DeltaTime for it.