Do I need to add pawn to scene afterchanging the code?

Hi!

I was reading this tutorial about input and pawns: Player Input and Pawns | Unreal Engine Documentation
It seems that I placed the pawn on the scene before the input managment code was added, I thought that it would be no problem. But when I finished this tutorial and pressed play, I found that the pawn don’t move.

I started debugging using log methods for the values of currentVelocity, NewActorLocation varialbes, etc and found that the values are calcuting properly, but for some reason SetActorLocation don’t work. I was working on it for 2 hours and then decided to delete this pawn and place it again. Suddenly, everything worked perfectly.

Maybe, there is something I don’t understand in hot reloading? But when I added GEngine Log methods in my code, they worked and I read the messages on the screen, so I’m sure that the compilation was successful all the time while I was “searching for bug”.

What could be the problem? It works now, but I don’t want to make this mistake again in the future :slight_smile:

You don’t give enough info to pinpoint exactly what went wrong. More testing on your part will be required.

Generally, I don’t trust the hot reload feature. Every time I’ve used it in my projects, the compiled results are corrupted. Any time I make changes to my C++ code, I restart my editor session.

Possible areas to investigate:
-Check your game mode and the pawn being used.
-Check any references to pawns within your level blueprint. Are they out of date?
-Does closing the editor and reopening it work?

It’s possible your Controller didn’t possess the Pawn