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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Character Reference in player controller is null in Packaged game.

Hello,

It seems I've encountered a problem when packaging my game. Some details before I get to the problem. My character class is a child class of BP_Character that is split into two genders BP_Male and BP_Female. In my character creator I set if the character is male or female and then spawn the child based off that decision. So now you have the background.

In the game world I spawn the character and load it's variables from the character creator. I cast to the parent BP_Character in the Player Controller as seen here. alt text

The problem I'm having is that it works in Standalone mode but does not work in a packaged game. The Character reference is not valid even though it is in the editor.

Would someone know what my problem is?

Thanks

Product Version: UE 4.20
Tags:
more ▼

asked Sep 06 '18 at 09:53 AM in Blueprint Scripting

avatar image

xRoci
7 2 2 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Well sometimes order of initialization is different in packaged game. Maybe this is the case. You can try to call Delay until GetControlledPawn returns a valid result. Also, try to package your game 'By the book'.

Btw. do you test this in multiplayer?

more ▼

answered Sep 06 '18 at 10:40 AM

avatar image

ortroll
142 1 5 9

avatar image xRoci Sep 06 '18 at 12:19 PM

This seemed to work for me. I added a function to the event tick of my player controller that checks if it's valid, if it's not it keeps looping until it is valid. Now I need to rework my save and load feature to be in line with this.

And no, no multiplayer yet.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hello,

BP are not cooked by default, you have to use a bp class.

See here:

https://answers.unrealengine.com/questions/130256/whats-the-correct-way-to-load-blueprints-for-packa.html

Cedric

more ▼

answered Sep 06 '18 at 11:00 AM

avatar image

uced
855 75 92 361

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