Button flashing in upper left corner

Hello,

I’m fairly new to UE4, and trying to develop a small mobile game while learning things.
I encountered a few issues, but managed by searching around. However, I can’t seem to find any similar issue to mine right now, and am kindly asking for your help!

Basically, I’ve got sprites spawning randomly on screen, and when clicking on them, I want a widget (which is just a button, for now) to appear on the center of this sprite. I’ve done that, but facing two problems (which might or might not be connected):

  • My widget is sometimes poping for just an instant in the top left corner before repositioning, and I can’t figure out why
  • Occasionally, my widget doesn’t spawn at the right position (might just be my math) and doesn’t seem to be active (my button doesn’t seem to fire an event when clicked)

The first point here is the one bothering me the most for now.

How I add my widget:

My widget BP and DisplayWidget methods (init is just setting WidgetRef):

Thanks for reading me!

I managed to solve my problem by adding my widget directly into the blueprint containing the sprite. Seems to work fine, not sure if it was the best solution though.