Custom camera tweening being delayed if fps is high [SOLVED]

because of how the script works with the tweens and the mouse orientation camera offset whenever i try that it just ends up really choppy

did you tried making task.wait() to no number ?

just tried that, had the same main delay issue as with heartbeat

i tried something that kinda worked (setting valuee = 0.08 * (deltatime * 60)) but the problem was because of how the fps fluctuated it ended up looking a little laggy; is it possible to get the average of delta time?

I have no idea to runservice all I know is that render stepped is fire on render stepped I know nothing about delta clock

I started tinkering with some of the code that kinda worked earlier and managed to actually come up with something that worked! Here’s what I changed:

local fps = 1 / game:GetService("RunService").RenderStepped:wait()
local valuee = 0.08 * (deltatime * (60 + fps))

Now any fps count should work well with smooth camera tweening

Yes, that’s a thing! Using FPS to increase that number is a option. Iam glad youve solved it!

I would recommend changing those if statements to a mapping table.

I researched a bit on the devfourm and couldn’t really find a mapping table documented anywhere. Can you link an article here? I’d like to read into it.

A mapping table is a way to avoid a lot of if statements, and do a table to map the statements. Here is an example.

local num = math.random(1,5) --a number in between 1 in 5

if num == 1 then
print("number is 1")
elseif num == 2 then
print("number is 2")
elseif num == 3 then
print("number is 3")
end

--But we can do this alternatively, to improve efficiency.

local t = {
  [1] = "number is 1",
  [2] = "number is 2",
  [3] = "number is 3"
}

local num = math.random(1,5)

print(t[num])

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.