Code compiles in Visual Studio, but the changes are not reflected in the editor
I am having a lot of trouble trying to figure out what my problem is. My code compiles successfully within Visual Studio, but the changes that I make to my code are not appearing in-editor. For example, I changed some of my variables from the uproperty VisibleAnywhere to EditAnywhere, but in the editor they are still showing up as greyed-out boxes that I cannot change (I had heard hot reload is finicky with header files). I also added an OnClicked function to a skeletal mesh, but this function is not being called when I do click on the skeletal mesh, and I have a feeling it is due to the changes in code not being reflected in the editor. I have tried deleting the visual studio project file, the intermediate folder, the binary folder. I tried opening visual studio from the editor after generating project files, but that didn't work either. I have even cloned the repository from github hoping that it would fix the issue, but it did not. I am not sure if this is a hot reload issue, but any help would be greatly appreciated.
edit: So on second look at my code, I determined why the editor was not updating the variables I changed, and it was simply because I declared an instance of the struct containing those variables with VisibleAnywhere, so of course they would not be editable. But, I am still having difficulty with the clicked events. The definition of the function in my .h file is this:
And in the constructor in the .cpp file,
And the actual function:
Any help with this problem is very welcome.
Solution: Make sure you have collision enabled on your mesh for onClick events otherwise your onClick event will not fire as your mouse click will not see your mesh :)
answered Jul 09 '18 at 09:46 PM
This may seem like a stupid question, but did you press the compile button in UE4? I used to have the same problem when I would compile in VS17 instead of with the in-editor button.
answered Jul 09 '18 at 07:43 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here