LogScript:Warning: Divide by zero: Divide_FloatFloat but am not using divide

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?

1 Like

It’s part of UKismetMathLibrary.

float UKismetMathLibrary::Divide_FloatFloat(float A, float B)
{
    if (B == 0.f)
    {
        //@TODO: EXCEPTION: Throw script exception
        FFrame::KismetExecutionMessage(TEXT("Divide by zero: Divide_FloatFloat"), ELogVerbosity::Warning);
        return 0.f;
    }
 
    return A / B;
}

I can’t see any way except modify source code or find it manually.
But this log warning thrown by math node in blueprint.

Oh. Manually means, like You’ve tried:

Hey -

Were you able to try out 's suggestion below to solve the problem? If you are still having any issues feel free to respond back to this post.

Cheers

Yes I have tried this And this is what I get:

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).

I tried responding the day after I posted this but the server was down and I had forgotten to come back to it.

's answer was informative but not really a solution.

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.

Hey -

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?

Cheers

19362-screenshot+2014-10-28+17.21.35.png

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.

19625-dividebyzero.png

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.

Thanks for your time looking into this.

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.

Hey -

RenderToTexture is used to give a 2D sprite the illusion of 3D as the player camera rotates around the sprite. It shouldn’t be called in your level unless there is a specific reference to it.

Here is the documentation on the RenderToTexture_LevelBP:

Cheers

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.

2 Likes

Let me add,if your Engine is Release vision, put breakpoint will not work, vs will show “No Symbols have been loaded for this document”
image

We need go to Epic, check “Editor symbols for debugging” and install

Then go to VS, debug->options->debugging->symbols, add the symbol path we installed(maybe “D:\UE_5.0\Engine\Binaries\Win64”)

A healthy breakpoint
image

1 Like