I’m having an extreme struggle with my current situation. I’m using @BRicey763 his bezier curve module, but i’ve ran into the issue where mobile players experience bad performance in cutscenes. My code is as followed:
for i = 0, 1, (speed / 1000) do
camera.CFrame = CFrame.lookAt(sceneBezier:Calc(i), folder:WaitForChild("Target").Position)
task.wait()
if shouldFade and i > (fadeTime or .7) and not faded then
faded = true
spr.stop(fadeFrame, "BackgroundTransparency")
spr.target(fadeFrame, 1, .6, {BackgroundTransparency = 0})
end
end
Now, i could convert this to RenderStepped, but i wanna know first if there’s a better way to fix this.
You could do a test to assume if a player is on mobile or not, and if they are you could reduce the rate in which your bezier curves are getting computed, capping the update frequency to maybe 30 hertz instead. It may be better to use RenderStepped and just store a timer that determines when the next update should be performed.
local UIS = game:GetService("UserInputService")
local function isOnMobile()
return not game:GetService("GuiService"):IsTenFootInterface() and not UIS.MouseEnabled and not UIS.KeyboardEnabled
end
The camera only ever needs to be updated once per frame, so you should update it in a RenderStepped function and use real time as the input to the curve.