Hi! I want to get my Int value from the parent actor blueprint, but every time I try to get the Int value in the Child BP, I get its default value of 0, which is different from what I get from the parent. Here are the Parent and the Child BP that I use.
It’s because Parent’s BeginPlay is not executed; You need to call it in your Child BP. Right click on Event BeginPlay and select “Add Call to Parent Function”.
Aah, yes, I missed that. Of course.
However, the spawned child actor and the parent actor that spawns it are not connected. If one actor spawns another, it does not make it its parent. The spawned child is an independent instance, and its parent’s Int is 0.
Is setting Int and spawning a child is the only purpose of the parent, you don’t need it in the level at all. Just place a Child Actor in the level, and remove the Spawn node.
It’s parent class, not parent actor. These two actors that you end up having in the level are absolutely independent of each other.
Everything you have in your parent class can be accessible and executed in child class.
I can get the variables from the parent BP
Yes, because default values are the same in the child class. When you get them, you get them from the default parent class, not from the actor in the level.