Function doesnt work until i compile, when i start Editor

I have made function that adds items i pick up to my inventory. When i start Editor it doesnt work, i have to compile Blueprint that holds that function. So it goes like this. I start Editor, pick up doesnt work. I compile SAVE my blueprint. It works. I Turn off editor and turn it on again. doesnt work, until i compile that blueprint again.

Edit: it print no space before compile, after compile it print has space.

Can’t say why (structs can act up in a similar fashion at times) but I’d just redo this function.

I have a similar issue sometimes. When I open a level, nothing in the Level BP works, including trigger overlap events and whatnot. After compiling the level BP everything starts working. It happens seemingly at random and I have no idea why it happens.

This is one of the reasons why I dread using structs. Every time I make changes to a struct the same would happen to me. It was so bad at one time I even made a utility widget that would load all the blueprints that reference the struct, refresh all nodes in it, compile and save.

By redo you mean, creating new function with the same exact nodes? And hoping this time it will work?

Can you tell me more in detail how that works?

Or just straight up show example ? So i can copy it

Yes, unless you’re using structs - are you? When you open the project, are you seeing any warnings / errors in the log?

No errors, By Struct, you mean “Blueprint structure”, if yes, im using them and they are being used in this function. Should i really avoid using them? Try to make this invetory system without them?

Yup, I meant the struct - blueprints structure. Now, since you’re desperate, consider the following:

  • make a copy of your project and open it
  • open the struct that that very function is using
  • add any variable to the struct
  • save the struct
  • shut down the editor
  • ignore any & all other prompts to save or compile - cancel / ignore all
  • open the project and see how things are

Also, apologies for asking about structs; I now see clearly there is an attached image and you’re clearly using them. Not entirely sure how I missed that…

Manually paste the path to the asset. I added delay just in case.

Oh and this will only work in Editor Utility Widget

To get the correct path right click on your struct in content browser and select “Copy Reference”. Then paste it in the node.

That didnt help :frowning: . I created new project. Just to try to make this inventory. And it happened again. and pretty early stage too. Works after compile, but fresh editor start or Standalone play doesnt work. I feel like i must be doing something wrong, because it bugs out so consitently. One would think that such bug would be fixed by now.

Blank project with this inventory, made up until it stopped working. If anybody can tell me, workaround that works with this. or tell me what im doing wrong. ill be grateful. E to pick up, tab to open inventory.