- Home /
Wild fluctuations in performance when built into an exe...
Several of my classmates and I made a platform game in 2 weeks for a small project with Unity.
I used var vert : float = Input.GetAxis("Vertical") * movement_speed;
for moving the character around, movement_speed was set to 0.15, and seems to work fine with our animation.
So we get finished and I build it as an exe, my level seems about the same, except I noticed at the very beginning I was moving irregularly fast. However in the next two levels which were a lot smaller then mine the player character could almost fly through at crazy speeds.
I'm sure it's related to the amount of stuff going on in each level, for instance on one of those really fast levels it slows down to normal at the end where there is bunch of spike traps/lights, an overall fairly dense prefab.
So I am wondering how to predict this, or combat this kind of outcome? Or some way to test pre-build if these kinds of problems will arise. We didn't use any objects with crazy vert or polygon counts, and within unity we didn't notice the speed difference at all. I tested the FPS with Fraps (in the exe version) and noticed that it had a large range usually between 50-110, and more like 150 on the smaller levels.
We have a lot of lights & shadows in our levels based on the game's story, I'm wondering if that could be the case but I don't have the experience to know.
I changed all the lights that were Soft Shadows down to No shadows, and while that helped the performance, there is still a large gap in how fast the player moves between the different levels. Is there something I am missing from my movement script to cap the speed?
Answer by LeviS · Nov 08, 2010 at 09:10 AM
Figured it out. Feel like a fool, I forgot vert *= Time.deltaTime;
to make it per second not per frame. And having so many lights casting shadows was a problem too, but now the speed is standardized across levels.
Your answer
![](https://koobas.hobune.stream/wayback/20220613082315im_/https://answers.unity.com/themes/thub/images/avi.jpg)