Why does my c++ class keep disappearing after I close my engine?

Hey guys, I am currently learning c++, and i attatched a very basic c++ component onto an actor that just returns ‘Mover is ticking’ in the log every frame.


But every time i close the editor and re-open it, it disappears and i have to press compile, then re-add the mover to the actor. Is there a way to make it stay permanently?

You have to compile it outside the engine. Close the engine, compile on visual studio, rider or how ever you want and then will be compiled. If you compile in engine you are just doing a hot reload, which is temporal and will be discharged when u close the engine

I have tried that. After i added the mover to the actor, i saved and closed the engine. then i went to the Mover.cpp, and did the Win64 Development Build. but when i re-open unreal its gone? am i doing something wrong?

It’s probably live coding screwing up your code in conjunction with VS. I’ve noticed that if it’s on it will override some code changes.

so do you suggest not using live coding and using another way?

I turn it off & shut down the editor before doing larger code modifications (especially when it comes to header changes).