The problem is that even though the object is spawned the VS debugger says the object is nullptr. However, if its a local variable the object is not a nullptr. I also tested by adding debug text doing:
Is this multiplayer?
If yes VS showing owning game instance where this arrow exists, probably client instance. I don’t see RPC to server which should spawn arrow.
If it’s single player, then… Magic. It’s really strange that it prints both null and not null. Maybe you are in Development build? Step-by-step can really be messy in that case, variables not in scope can be null, it can show that it executes line which really shouldn’t be executed there etc. If you want do debug code you should use Debug build.
How exactly it prints both statements? Can you show screenshot of debug messages?
P.S. you can set 1 frame duration for debug messages to separate them:
GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::Blue, TEXT(“NOT NULL”));
Now this message will show for 1 frame and will look like one static text per actor.
Because you are printing out on the condition of “arrow” existing in Tick( ), which is called every frame that passes in game, it will print out the message “NULL” for every frame that “arrow” doesn’t exist, which will be every frame before you call SpawnArrow( );
If you check the DebugMessage in Tick after you spawn the arrow, the condition should then be true.
Thank you for submitting a bug report, however at this time we believe that the issue you are describing is not actually a bug with the Unreal Engine, and so we are not able to take any further action on this. If you still believe this may be a bug, please provide steps for us to reproduce the issue, and we will continue our investigation.