Hi ,
I ran some additional tests on this issue today, and it looks like it is an extension of an issue that I have already submitted a report for (UE-6944). Adding a new UFUNCTION to a project that has already had a Hot Reload performed on it will result in the new UFUNCTION (as well as any already existing UFUNCTIONs) not appearing in a Blueprint previously created from that class. I am going to add some additional details to my previous report to include what I saw when testing your report.
This is the process I ran through and the results that I saw.
I started with a brand new code project created using the first person template. I built the project in Visual Studio, then opened it in the Editor. I added the following code to the default Character class included in the template:
UFUNCTION(BlueprintImplementableEvent, Category = "Test", meta = (FriendlyName = "Test Function"))
virtual void TestHotReloadEvent(bool CheckThis);
With the Editor open, I built the project in Visual Studio. Once the build completed, I opened the MyCharacter Blueprint in the Editor (this Blueprint is derived from the default Character code class). In the Graph tab, I right-clicked on the graph and ran two searches: one for “hot” and one for “test”. The new function showed up in both searches. However, this apparently only happens because this is the first hot reload performed on the project that involves a UFUNCTION. If I removed the UFUNCTION and re-added it with another Hot Reload, it would not appear in any searches in the graph until I had closed and re-opened the project in the Editor.
I then added a UPROPERTY variable to the default Character class:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Test")
float HotReloadTest;
I performed another Hot Reload and this variable appeared in the Details tab, as well as in the My Blueprint window in the Graph tab. However, neither the Get or Set nodes were available when I performed the same right-click searches in the graph, and the previous UFUNCTION no longer appeared in the search results (this is similar to what I had reported previously in UE-6944). Closing and re-opening the project in the Editor allowed the UFUNCTION to appear in the search results, as well as showing the Get and Set nodes for the UPROPERTY I had added.
I then added another UFUNCTION to the default Character class:
UFUNCTION(BlueprintCallable, Category = "Test")
void HotReloadAndReflection(bool TrueOrFalse);
I also included a blank implementation in the source file for the default Character class and built the project in Visual Studio to perform another Hot Reload. Both the new and original UFUNCTIONs were not visible when I performed the same right-click searches for them in the Blueprint graph (this is what I had originally documented in UE-6944), and the UPROPERTYs get and set nodes were no longer visible in the search results (it was still visible in the Details panel, as well as in the My Blueprint window). Closing and re-opening the project in the Editor allowed everything to show up in the search results.
All of the tests above worked fine in 4.5.1, so it looks like we broke something in 4.6. When you had mentioned that you did not see the UPROPERTY that you added before performing a Hot Reload, where were you looking for that variable to appear?
@gormed,
BlueprintImplementableEvent
and BlueprintNativeEvent
will appear in either the right-click search results in the graph or the My Blueprint window depending on whether or not they have a return value. If they have no return value (void
), they will be in the right-click search results. If they do have a return value, then they will appear in the My Blueprint window in the Overridable Functions section.