Description

Creating a float variable named lifespan in an Actor Blueprint and setting a default value for it will override the parent class' life span setting. I was unable to find any variable in the Actor class named lifespan, but there is a variable named InitialLifeSpan that stores the default life span for the Actor.

Either the Blueprint should not allow a variable to be named lifespan, or that variable should not override the parent's life span value.

Steps to Reproduce
  1. Create a new blank Blueprint project.
  2. Create an Actor Blueprint.
  3. In the new Actor Blueprint, add a new float variable named lifespan.
  4. Compile and save the Blueprint.
  5. Set the default value of the lifespan variable to 5.0.
  6. Compile and save the Blueprint.
    • Note that the default value resets to 0.0.
  7. Change the name of the lifespan variable to something else (eg. TestVar).
  8. Compile and save the Blueprint.
  9. Set the default value of the variable to any value (eg. 1000.0).
  10. Compile and save the Blueprint.
    • Note that the default value that was set is not reset to 0.0 this time.
  11. In the Blueprint's event graph, use the Get Life Span node to retrieve the Blueprint's life span and print that to the screen on tick.
  12. Place an instance of the Blueprint into the level.
  13. Start Simulate or PIE.

RESULT:
The Blueprint will print to the screen a countdown from 5.0 to 0.0, when the Blueprint will be deleted from the level.

EXPECTED:
The Blueprint will print to the screen a continuous series of 0.0 values and will not be deleted from the level after 5 seconds. Alternatively, the Blueprint will not allow a variable to be named lifespan.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Cannot Reproduce
ComponentUE - Gameplay - Blueprint
Affects Versions4.12.54.14.14.15
Target Fix4.26
Fix Commit12964345
Main Commit13686746
CreatedDec 19, 2016
ResolvedApr 22, 2020
UpdatedNov 3, 2020
View Jira Issue