I want to create a health bar and I don't know how and it does not have to appear on screen.
If it does not have to be on the screen, then you do not need the graphic representation of the value -- just the value. A simple int field should suffice. My Value Display Tutorial may be able to help even without the displaying of the value.
Thank you. Also I wanted to know how to make object spawn when a button is pressed.
Use an 'if' statement. Put the condition inside for the argument of the 'if'. Add the object into the world from within the block of the 'if'. Not enough information to help any further (no code; 'button' is ambiguous; too general).
The code I have tried is this
< Code Omitted >
then it says "cannot find symbol - variable.
I presume 'bullet' is highlighted.
Do you declare the 'bullet' variable anywhere? If so, where? How?
Does it currently reference an Actor object?
Show more code.