Download

Weird bug with blueprints: Double execution with variable changing value

Hello!

I have encountered a very annoying little bug, which hinders my progress. Although I’m not quite sure if actually is a bug or a feature, since I’m new to unrealengine (I’m 8 hours in).

I have the following blueprint:
JqdyIQz.jpg
Imgur Link

It consists out of two parts: The top part is triggered as soon as the left mouse button is pressed. It gets the direction vector for the mouse press on the screen. In short, it does nothing more than find the coordinates of the point I clicked on in my game.

The bottom part is triggered every time the mouse moves (Mouse X/Y events). It uses a horizontal plane with the point determined in the top part as origin. After that, it determines where my mouse pointer is intersecting with the plane (what point on the plane is my mouse pointing at). Now I take the coordinate difference between the collision and the original point, resulting in a always horizontal vector. Now I want to subtract that vector from my pawn’s position, so I could theoretically move around by clicking and pulling the game world.

Now comes the part where things get really funky: as soon as I add the marked part, it appears as if GodhandMoveUpdate is getting triggered twice every frame, except that the second time results in Line Plane Intersection having the same coordinates as MoveHandStartposition! But this ONLY happens when I add the marked part.

Am I missing something very obvious? Or did I just find a very obscure bug?
If so, how can I provide more helpful information?
Can I upload the entire project file (it has the default starter assets in it), or isn’t that allowed?

Best Regards,
Lukas

Have you stepped through it? Actually If I were you I’d add some code to cast some of your variables out to the screen as print. so you can see what is causing the problem and what might be getting an unexpected extra input.

Note to Devs :slight_smile: I would love to have a Debug feature on the lines with a bubble with a value for Int’s for example etc, and for Bool lines, True or False etc so I didn’t have to print them out. I’m new at UE4 as well so I’m sure theres a much more elegant way to do this that will present itself in the coming months.

I’m not going back to Unity. :wink: So the path is forward lol.

I agree. This is a good place to start.

While stepping through blueprints, you can hover over an output node to see what each variable is outputting. That should avoid the need for printing to screen for the most part.