x

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"

Keep loosing(?) playercontroller

I currently have C++ code for playercontoller that a playercontroller blueprint derives from. It's setup in gamemode to be default.

Since converting project to 4.18 I have random instances where after I compile my code from what it seems the playercontroller is reverting or not loading. I know this because there should be stuff printed onscreen in the beginplay() area. It works for so long and then I hit PIE and none of the code in the playercontroller runs making me think it's using another playercontroller.

Closing and re-opening the editor makes it work again usually, however now I'm stuck in some loop. When I close/re-open it runs but not on the current compiled code (has error). If I compile the code and run again I seem to loose the playercontroller and none of the code runs. Then close/re-open editor and playercontroller code runs but not the most recently compiled so has error.

Been trying to fix this error in my code but I can't get new compiles to take.

Product Version: UE 4.18
Tags:
more ▼

asked Oct 27 '17 at 01:12 AM in Bug Reports

avatar image

Mctittles
66 4 8 13

avatar image Doug E ♦♦ STAFF Oct 27 '17 at 04:16 PM

Hey there,

Are you compiling from Visual Studio or preforming hot reload from the editor / with the editor open? If you haven't, please try compiling from Visual Studio to clear out old hot reload .dll files. Additionally, when the BeginPlay() text does not print, can you check the GameMode to see if the Player Controller setting there has been changed?

avatar image Mctittles Oct 27 '17 at 04:39 PM

I'm compiling from Visual Studio. I fixed my bug loop above though by pressing the compile button from the editor next load.

Since then I have been still experiencing intermittent times when I PIE and none of the playercontroller code executes. I've tried compiling with the editor button and doesn't change anything.

I've also checked and double checked my gamemode and world settings when this happens. Here are the events:

  • Start up Visual Studio (.sln file launch) then start up editor (or other way around).

  • Mess with code/compile

  • PIE

  • Mess with code/compile

  • PIE

  • Mess with code/compile

  • PIE ---- Now nothing from playercontroller shows up in editor (just blank screen because level is blank)

  • Close Editor/Re-open

  • Compile again

  • PIE works now

  • repeat

Sometimes it takes multiple restarts or shutting down both visual studio and editor for it to start working again.

avatar image Mctittles Oct 27 '17 at 05:36 PM

Just an update right now I loaded up the project I was working on yesterday which I made some code changes that showed up yesterday.

When launching fresh today and I hit PIE it was not showing the most recent changes. Visual Studio said compile was up to date. I pressed the compile button in the editor and then PIE showed the recent changes.

Also sometimes I get a message when launching the program from the editor along the lines of "This program was compiled in an earlier version of unreal would you like to recompile now?"

avatar image Mctittles Oct 27 '17 at 05:37 PM

Could this have something to do with updating a 4.17 version to 4.18?

avatar image Doug E ♦♦ STAFF Nov 01 '17 at 03:22 PM

I can't say for sure if it is an upgrade issue. Have you been able to reproduce the behavior in a new 4.18 project or a new 4.17 project after upgrading? Additionally, what do you mean by "mess with code"? Can you elaborate on what code changes are being made / what information you're looking for that is not being updated when you hot reload?

avatar image Mctittles Nov 01 '17 at 03:50 PM

In "messing with code" I've been mainly working on building interfaces via widgets in c++. It usually involves changing a number (x/y/width/height) of a few items then recompiling/reloading to see how everything looks.

I also have a directory browser and had to troubleshoot a few things interface wise for that.

This project is completely blank (everything deleted from level) and I only have a gamemode/playercontroller with playercontroller being done in c++. I have created this project to focus and test one singular thing (file browsing with widget interface) which will later be included in my main project. It's mainly a testing bed for code and so I work by making changes and checking it over and over.

It could be just my head but it also seems to be the longer I let it sit idle the greater chance when I hit play it will be blank. If I alt-tab to something else for awhile then come back and hit play I just Know it's going to be blank and have to close/restart the editor.

Also it seems every time I start up the editor I need to recompile the code to get the most recent changes showing up.

For example if I have a button with text inside that says "Load". Then I change it in code to say "Load File" and recompile. If I test in editor and it is blank then close/restart editor if I hit play without recompile it will say "Load" it seems to only show the last played compile. If I recompile then it will say "Load File"

I suppose since this is only code I will try a fresh start and see if that fixes the issue. Super annoying one it is :).

avatar image Mctittles Nov 03 '17 at 12:43 AM

I created a new project and copied all the code over to it had the same problem but found what is happening. So I was wrong the beginPlay is firing I just had this at the top of my code and didn't pay attention:

 if (IsLocalPlayerController()) {
         if (wLinkerWidget) {

which is checking this:

 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets") TSubclassOf<class UUserWidget> wLinkerWidget;

Seems every so often wLinkerWidget is not there so it doesn't run. Repeated compiling doesn't change this and restarting the editor is the only way to get it back. Not really sure of the solution for this.

avatar image Mctittles Nov 03 '17 at 12:48 AM

Another update. This happened again and I went and checked the playercontroller blueprint (based off my c++ one) and under widgets the linker widget dropdown was set to none. Somehow it is getting changed on it's own.

avatar image Mctittles Nov 03 '17 at 03:01 AM

Happened couple times more. Can confirm the widget select was set to none. Restarting or changing the dropdown back fixes it.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey Mctittles-

After your latest comments, I found that TSubclassOf variable values are reset on hot reload - a report for this issue has been logged here https://issues.unrealengine.com/issue/UE-51994 . You can track the report's status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers

Doug E

more ▼

answered Nov 03 '17 at 04:21 PM

avatar image TheJamsh Oct 15 '18 at 02:43 PM

Hi Doug, it's been almost a year and this bug has now been marked as "Cannot Reproduce" despite 42 upvotes, your confirmation and affecting four versions of the engine.

Will this ever be fixed?

avatar image PY20-GX Jan 11 '19 at 03:38 AM

NOT fixed as of 4.21.1. I don't know if it was actually fixed in 4.21 and it was re-introduced in 4.21.1, but it is definitely still recurring.

Specifically, I have the following declared in a class derived from UActorComponent:

 UPROPERTY(EditDefaultsOnly, Category = "Setup")
 TSubclassOf<AProjectile> ProjectileBlueprint;

Projectile Blueprint is reset to None every time the editor is re-opened or Hot Reloaded.

(comments are locked)
10|2000 characters needed characters left
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