When I play my level in the editor the Output log is spammed with “LogScript:Warning: Divide by zero: Divide_FloatFloat” there is no reference to where it is coming from and the ‘Message log’ does not show any errors. I have searched my project for ‘float/float’ and the only references to division show in a blueprint in the engine folder called “RenderToTexture_LevelBP” as this is an engine BP I don’t feel like I should mess with it.
Is there a way to find where this is coming from? I have spent a few hours putting break points in my code trying to isolate it but am not having any luck. Is there a way to break when there is an error or warning? If not there should be.
I’ve been just dealing with it but it makes it annoying to debug other issues because of how polluted the output log is.
As I’m writing this I realized that it says logScript not logBlueprint. As this is a Blueprint only project is this a bug?
As the only result is in an engine BP I believe this could possibly still be a bug possibly with that engine BP. It should be noted that this only happens in MP (setting number of clients to more than two).
Obviously the code you posted is the division BP code and that is not where the error is, but whatever code is calling that code and is passing 0 as the denominator. From my screenshot above it would suggest the error is in the RenderToTexture_LevelBP engine BP.
I am open to suggestions though and I am willing to do some debugging if you can point me in the right direction. I will try to respond faster as well.
Could you post a screenshot of the error message you’re seeing? Also, does this message come up when you first start play in editor mode, as you leave play in editor, or does it appear while playing? What are you doing in game when the message appears?
The error happens when I play the game in the editor and I have it set to more than one client. It appears to happen at least every frame judging by how fast the log is filled. Messages stop repeating after the game is stopped.
Ideally if the error is coming from the division BP, shouldn’t we get a reference to the BP node where the warning is being triggered?
I looked in the message log as it sometimes gives ‘links’ to the BP node that the error is coming from but it does not show any warnings in the message log only the output log.
If this is happening every frame then it sounds like there is something that is being called with a tick event. If you have any blueprints that include a tick event check for any calculations or comparisons that may be causing the warning.
So the only blueprint that uses ‘Event Tick’ happens to be the same BP “RenderToTexture_LevelBP” (I don’t use tick myself as it is evil and everything should be event driven)
Does anyone know what “RenderToTexture_LevelBP” is used for? If I knew what that engine BP was used for I might be able to pin point what is causing it from my project then I might be able to make a replicate-able process showing the bug.
Idk if this means anything but I just discovered that once I move on the server the error stops coming in. Moving around on the clients does not stop the error. At least I can stop the error so I can see my own debugging easier. Still doesn’t fix the problem though.
I found the problem. It was a BP division node in an AnimBlueprint and for some reason was not showing up in the search results until I edited it again. Could be a bug but now it is always showing in the search results so I cannot replicate the problem. For now I am happy that I have a clean log again. Thanks for your time trying to help me track this down.
For future people having trouble finding out where this warning comes from: open KismetMathLibrary.cpp in Visual Studio, search for the appropriate text (such as “Divide by zero: Divide_DoubleDouble”), put a breakpoint there and start the editor with debugger attached. Once it hits the break point, go up 2 levels in the call stack and under Locals → Stack, you’ll see what is the offending function.