Edit MattK: The display name is different when running PIE through the editor. This sort of inconsistency seems wrong. We should probably not ever be using the display name.
Spaces are removed from Actor Display Names in packaged projects but not in PIE.
Reproduced in 4.7.5 binary and Main (//depot/UE4/Promotable-CL-2505032)
User provided test project available here:
https://answers.unrealengine.com/storage/temp/37971-substringtest.zip
Plan (from conversations w. MattK):
UKismetSystemLibrary::GetDisplayName should always return the Actor FName, and ideally be changed to GetActorName.
GetActorLabel does not change.
—
1. Open any project
2. Create a new Actor Blueprint
3. Drop the BP in the level
4. On Begin Play, Get All Actors of Class (Player Start)
5. Get at Index 0 > Get Display Name > Length > Print String (see attached image)
6. PIE, note that the Length is 13 (Player Start#) which includes the space
7. Package for Windows 64
8. Play
Result:
12 is printed, which is PlayerStart#, the space having been removed.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay |
---|---|
Affects Versions | 4.7.5, 4.8 |
Target Fix | 4.9 |
Fix Commit | 2518476 |
---|
Created | Apr 9, 2015 |
---|---|
Resolved | Apr 21, 2015 |
Updated | Apr 27, 2018 |