- Home /
Gameplay issues when playing in Editor. Works fine in build.
Ok,
I'm having a really weird issue with my characters Jumping controls when playing the game in the editor. Normally the character jumps at a set height, but after I've been working in unity for while; opening/closing the programming, creating assets, adjusting prefabs etc. his jump controls go all wacky.
The character will start to jump at half height for a few button presses and then suddenly launch into the air with 10x the force he should. Then a few jumps will be normal and then BAM super jump... Sounds cool, but it's not. It's extremely frustrating. It's getting to the point that i can't test my game in the editor because of the inconsistency.
Normally I would assume this is a problem with my character controller and jump scripts, or something like that, except that when I build and run the game it works perfectly fine!
Is there some sort of degradation in the editor or known bug that would cause this type of issue? I've tried searching everywhere and can't find a single mention of anyone else having this issue. It's really becoming a problem as I can't properly test my game without making a full build.
For reference I have a pretty solid PC. Intel i7, Geforce GTX 275, 8G Ram, Windows 7 64bit. So I can't imagine it's hardware bottleneck, also the fact that when I first start unity there's no problem. It happens after the PC's been running for a couple hours, and Unity has been launched/closed a few times. Normal workflow stuff...
Any help or direction would be so greatly appreciated!
I've come to find that running the game in editor with Game-view set to maximized ($$anonymous$$aximize on Play) works a lot more fluidly and closer to a build. I don't know if it's a solution in your case but sometimes certain hickups do tend to impact the physics for instance. The Profiler is also good to run on an in-need basis as this also tend to give the Editor hickups. You'll notice great difference especially if you've forgot to use deltaTime/fixedDeltaTime on certain frame independent values.
It's really hard to tell if it could be anything else. Do you have any editor scripts that could interfere with jumping? Is there any other logic connected to the jump button other than to issue a jump for the character? Are you using deltaTime/fixedDeltaTime the right way?
I always play with the game maximized, and I have tested not maximized as well to no avail.
When the player moves, his velocity is scaled by deltaTime before being passed off to the character controllers $$anonymous$$ove function. The jump script I'm using simply adds a vertical "force" value to the players velocity when the jump button is pressed.
movement is time based anyway, not frame based so execution speed shouldn't matter... (aka no i didn't forget to use deltaTime.)
Again, this ONLY occurs in the editor "play" mode, everything works fine when I build and run.
Did you click on another window? I've notice that clicking on another window (taking the focus from unity pauses the editor playback) while playing in the editor can occasionally have strange effects on unity.
Does the framerate suffer at all when the super jump happens? If some script or something is usurping control from the engine for a while, it can sometimes effect the physics.
You can try playin with the values in Time$$anonymous$$anager, see if that effects anything.
Thanks for the suggestions, but none of that was the cause. No other windows open, or programs running for that matter. No frame rate drop, just inconsistent results with the jump.
Another weird aspect of it; I've been trying to capture video of the bug, but every time i run the screen capture software the game runs fine. I'm really at a loss =(
Could it be drivers or other software then, have you updated Direct X and the Nvidia drivers, Windows 7 SP1 and latest version of Unity?
Your answer
![](https://koobas.hobune.stream/wayback/20220613081239im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
Implementing Deceleration on a car? 0 Answers
Input Help! 1 Answer
Keyboard input not working 3 Answers
How change speed of scrollbar (ui) with mousewheel 0 Answers