I’ve tried adding tick rate so it runs the code less often, however it still doesn’t fix the main issue as it runs at 0.7% script activity rather then the 4% before adding tick rate. The delay also doesn’t help the effect I’m trying to make using the distance value.
I’m running it on RenderStepped and the function is being called from a for loop.
Client sided activity will only count towards the player’s hardware, so if someone’s computer is not that great performance on client sided scripts will not be that good as well, but games run on a tick loop. Take unity for example, from my experience most things run through the Update function which runs every frame, and as long as you don’t have very complex calculations or very expensive code running every frame, you are most likely fine. I had a similar issue with my first person animated movement which was updated every frame, tested it in different machines and everything was fine.
I do however love the fact you’re adding such optimizations to your game, very unique and not seen that often