When a child actor passes a string to it's parent's overloaded constructor using an overridden function that returns a string it won't receive the correct string. I have verified that the correct function is being called in the child actor. Attached are the files and linked is a project that demonstrates the issue.
Google Link: [Link Removed]
Reproduced in 4.22.3 CL#7053642
Reproduced in 4.23.0 CL#8386587, 4.24 Main CL#9016221
1. Create a new first person shooter project with starter content.
2. Create a parent(ParentActor) and child(Child Actor) class (reference .h's and .cpp's attached).
a. In ParentActor add a UStaticMeshComponent* member and create a function (Init(FString)) to find a static mesh in the content browser and add it to the actor.
b. Create a virtual GetMeshPath function that returns a path to the relevant mesh .
b. Override GetMeshPath() in to have a path to a different mesh in ChildActor.
c. Overload the ParentActor Constructor to take in a FString and add a Static Mesh Component using Init(FString).
d. Make the Child Actor call the overloaded ParentActor Constructor.
3. Place the a ParentActor and ChildActor in the level.
Results: The ChildActor has the same mesh as the ParentActor.
Expected: Both actors have different meshes.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-80778 in the post.
0 |
Component | UE - Gameplay |
---|---|
Affects Versions | 4.23, 4.24, 4.22.3 |
Created | Sep 24, 2019 |
---|---|
Resolved | Sep 24, 2019 |
Updated | Sep 30, 2019 |