Getter value not being pulled through
I am trying to increase my score when an overlap event occurs, the code is called correctly but the value contained within the overlapped actor is not being pulled through.
For example, I spawn a powerup into the scene, it's powerupvalue is set to 50
When the overlap event happens, I call the following line of code:
The destroy part of the code works, but the value of the log always returns 0. If I run the following line of code within this snippet of code:
The value returned is also 0, but if I spawn a powerup and check it's properties in Details tab as mentioned above, I can see that the powerup value is set to 50.
Why is this happening?
asked Apr 21 '19 at 06:04 PM in C++ Programming
I found out why this is not working, I was using the wrong formatting value. My CurrentScore variable is a float so I should have been using %f in the Text. %d is used for integers so if I change the line of code from
The Output Log displays the correct value, more information can be found on the Unreal Wiki below:
answered Apr 22 '19 at 12:35 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here