Compile Error When Opening Project

I am having an error that is getting annoying. When I start up my project I have a constant compile error in my hud blue print. However, it doesn’t seem to be an actual error because I just have to hit compile and it works, doesn’t give me another problem until I complete close the project. I have found what I believe is causing it. I am casting to my hud in my character blueprint and if I take this out I don’t have a compile error when I load the game for the first time. However, I am casting to my hud in my character blueprint in another function and that one isn’t giving me a problem. Any ideas?

Hi xslayerz,

What is the specific compiler error it is giving? For instance, what is the cast attempting to accomplish?

Thanks for the quick response. I have added a screen shot of where the error cast is. But what it should be doing and works if after I hit that initial compile error, is that this is part of my inventory system. This part is seeing if the player is moving the item around in the inventory and is reassigning it to a new slot and it updates the player’s hud.

Hi xslayerz,

Can you tell us or screenshot the exact error you are getting? Also, try compiling both blueprints (the character and the HUD) to see if you get the error still.

,

Attached is a screenshot of the compile error when I open the project. This only happens when I first open the project from it being close. The only thing I have to do is hit compile and the errors go away. The first screenshot I attached in my first reply is what I have to do to fix it. I remove the exec to the cast t

o bp_hud. Then compile, save and close. Then I reopen the project no errors.

I spent the better part of last night tracking down the same issue. This morning I discovered this post:

In my case, the offending node is a cast to a custom PlayerController. If I delete that node, the project is fine, otherwise the project on open behaves identically to what you describe.

Blueprint interfaces as an alternative are new to me, so I’m digging through the docs on how to do that, but I wanted to post my progress here asap, since this is a pretty fresh post.

Good hunting! :slight_smile:

Hi xslayerz,

Have you been able to test what fisj suggested? Please let us know so we can continue testing as thus far I have been unable to reproduce this effect. Thank you!

Fisj,
Thanks for your post! I am sorry I have been out of town for the past couple days so haven’t had to to work on it till now.

,

I am working on trying to convert it now to an interface, will let you know if it works.

I tried to do the interface and it wasn’t working. However, I did get it to work. What seemed to be the issue was that I had a custom event that was calling a function and once I took the cast out of the function and put the cast to bp in the event graph it works perfect. I can close it and reopen, no error. Thanks for everyone’s help.