I made an object - a cube that produces 1 point each second. I also created a widget to show to the player how many points he currently has. I made a binding so that ### would be changed to the correct number of points. The problem is when I use "Cast to cube_name the cast always fails. I think maybe my widget where I try to cast cube_name doesn’t have access to it?
Hey there @Moniczka18! Welcome to the community! Your second image seems to no longer exist.
If I had to guess, it probably has to do with how the cast is set up, but since I can’t see how it’s connected it’s only a guess for now. I personally recommend handling your point logic directly attached to the player, their player state, or the game instance if you need to retain points over level transfers. If you don’t, you still would benefit from the UI just handling the display. A good example is this tutorial here:
Disclaimer: Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.
Almost certain the cast fails here because the Actor Cube reference variable is not pointing to an object, it was never set.
Creating a variable does not do anything, it just reserves the space (so to speak). Where is the actual actor cube instance - where is Szescian? How does the HUD know about it?
I made an object - a cube that produces 1 point each second.
And you then placed it in the scene? Dragged the actor into the world?