- Home /
Need help identify framerate issue in Profiler.
Hello
I am making an infinite runner where I am pooling a series of Bezier curves and then having the play travel it when it reaches it. I am using leantween to create the curves and using this to have the player travel it:
LeanTween.move(Player, Path.vec3, Speed).setOrientToPath(true).setEase(LeanTweenType.linear).setOnComplete(SetEnd);
Every time the player travels to the new path, there is a HUGE, crippling spike in my framerate. Could anyone help me identify the issue?
Is it because a new section of the level is being set active?
Would it be feasible to make all sections active on start, but have them hidden and move into place when you need them. Hiding them will cull the geometry, but you might need to disable/enable some scripts for them.
Another idea is, are you creating the tween paths during runtime? You might be able to precalculate and reuse your paths if your sections are always the same.
Thank you Jessespike for replying and Baste for editing my post.
I currently have a pool of path models with LTPaths attached to them. They are all disabled at start and then they are randomly enabled and placed. when the previous path is done. Each Path has a premade LTPath attached to it. I call use the LTPath to have the character travel through.
All LTPaths and models are being reused.