Unreal Editor keeps deleting my scripted actors

Hi. Problem is simple but i don’t know how the hell can i solve it. I am programming using C++. After i modify any of my script .h files (example: MyActor.h) my actors stops working in editor other than it was 5 seconds before. I can modify .cpp files. I hate this Editor. It keeps deleting my scripted actors from scene. It is scheme, how i (must) do.

  • Modify some .h file
  • Check if it working
  • No it is not working
  • Reopen UE4 editor
  • 0 elements on scene, i scripted before.

I am trying to write bush repulsion when pawn is near but it deletes all of the bushes and erases pawn’s visible element mesh data.
Please help me, i can’t reopen and add again 1000x bush or other actor every time i modify .h file.
I forgot to mention it - after modifying .h file, when i try to select bush it selects only Instance of “Plant” (this is the name of my script) and the position is in (0,0,0) and receiving location of actor is not working in C++ code (it returns actors position, not component’s position >.<)

Hi Razzorflame,

Can you provide me with either the code that you are using or a set of steps that I could follow to reproduce this issue? Also, let us know if this issue reproduces in a new project without any other additions. If we can get some good steps to reproduce this issue, we can investigate further. Let us know any additional information you can provide.

Have a nice day,

It would take so much place (2GB) so i deleted few files and folders:
Starter Content from Content folder
Rest doesn’t matter cause it was data base files from Visual Studio (pdb etc.)
Try to add some members to class “Plant” or “ControlledPawn” and then compile it. You will see that grass stops repulse from pawn.

Edit:
Just place one controlled pawn and few plants.

Hi Razzorflame,

I took a look at your provided project and I was unable to reproduce the issue.

To be as clear as possible, I placed an instance of the class ‘Plant’ and ‘ControlledPawn’ in the scene and noticed that the ‘Plant’ class cannot be moved, which is to be expected as it has no transform properties set in code as ‘ControlledPawn’ does. I then tried adding a boolean variable and a UPROPERTY property to the plant class and both of my actors stayed in the scene. I also attempted approaching the plant class with the ControlledPawn after applying a static mesh to the Plant class and it rotated as dictated by the code.

If this issue is still persisting, or I misunderstood what you meant by ‘add a member’, please provide me with a list of steps to reproduce the issue, as detailed as possible. I hope that I can help you resolve this soon.

Have a nice day,

Hi Razzorflame,

To continue assisting you, I will need more clear steps to reproduce the issue as previously stated. For tracking purposes, I’m going to set this question to resolved. If you still require assistance, please add a comment letting me know and the question will reopen so that we can continue further.

Have a nice day,