Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Hot reload not working

Hello I have a problem that hot reload isnt working at all. I added a minimal test case which "works" for me with UE 4.18.2 . I just put the actor on the map and nothing more. When I change some code in the TankPawn.cpp for example the

 auto targetVector = FVector(5.f, 5.f, 970.f);

to some other numbers, I compile and nothing happens in the editor... also when I click play. I added the following code:

 extern "C" {
             _In_opt_ void* hWnd,
             _In_opt_ const wchar_t* lpText,
             _In_opt_ const wchar_t* lpCaption,
             _In_ unsigned int uType);
 // Sets default values
     MessageBoxW(NULL, L"LOOL", L"LOOL", 0x00000000L);

to confirm that the object actually got reloaded... It gets called ( for me it also gets called 3 times or more, which is also strange because I have only one tankPawn in my map... but nevermind, this happened also in the standalone app, because the message box popped up 3 or more times. For me this is actually useless because I have to either shut down/reopen editor (which doesnt help), or delete, and add the pawn again into the map to make the code changes takes effect. I attached some code in the following link

EDIT1: It seems that the module is hot reloaded... but the params are NOT SET TO DEFAULT. When I open the properties editor I see my camera position and a small yellow arrow next to one of the params that I changed saying RESET TO DEFAULT. That is when I see the code I changed. Why this doesnt happen automatically? I didn't change the settings in editor

Product Version: UE 4.18
myproject5.zip (1.1 MB)
more ▼

asked Dec 26 '17 at 08:26 PM in Bug Reports

avatar image

12 2 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


It might happen sometimes that Editor and Visual Studio fail to communicate with each other and hence the Editor will not get Hot Reloaded even if your code successfully compiles. Simply close the VS and open it again from inside the Editor and it should work fine (If they still fail to communicate, then simply close and reopen both of them.)

With regards to the Blueprint exposed variables not automatically resetting to their default - I believe this is the intended behavior of Blueprints. As a programmer, you create a base class, initialize its properties with some default values and expose them to Blueprints for your Designers to tweak them and build the rest of the gameplay. It would have been catastrophic if all these already changed and tuned variables reset to their defaults C++ set values once you recompile your code! So once you create a Blueprint based on a C++ class and change the value of a property, next time you compile, you have to manually link that property back to its default C++ value by clicking on that yellow arrow next to it.

Hope this answered your question.


Ahmad Jamialahmadi

more ▼

answered Dec 27 '17 at 10:43 AM

avatar image

1.5k 10 10 18

avatar image martinkosicky89 Dec 27 '17 at 10:50 AM

Thank you, yes you are right... I fixed this catastrophic scenario by putting my NON-designer fields into BeginTick. I thought there would be some UProperty specifier to tell Unreal not to do this feature. Because there are use-cases where I don't want this functionality but I am modifying a UProperty... for example I am trying to tweak a fixed camera component aiming at my tank from a fixed angle... this is not a designer editable thing in my case (my decision). Because in each level I want to have the same fixed angle, and when I update my module I want to have a different fixed angle...

avatar image Vizgin Dec 27 '17 at 11:00 AM

If you want to prevent your designers from changing the variables in the editors, then either avoid exposing them to Blueprints at all or make them read-only for the Blueprints. To make them read-only simply mark them by UProperties VisibleAnywhere and BlueprintReadOnly and they cannot be changed in the Blueprints. If you want to go even further and make them project configurable and read-only even for your C++ classes, then you can give them a Config UProperty and make the variables read their values from one of your ~.ini files. Once a variable is marked with Config UProperty, it will become read-only and its value will not change at all (Though you will not get any kind of warning or compile error if you try to change its value. It will just ignore those changes and will not get affected). You can read about how to make a property Configurable in Unreal documentation here or briefly in my other answer here.

avatar image martinkosicky89 Dec 27 '17 at 03:18 PM

I have a CameraComponent that is somewhere under the RootComponent hierarchy... how can i tell not to expose the camera components local transform and local rotation ? I didnt specify to expose it... btw i attached code in the tankpawn.cpp in the attachment. CameraComponent is what i want to not be exposed

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question