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"

Editing this value in a Class Default Object not allowed?

I ported my game from 4.17 to 4.20, and a core functionality broke. I had an array of actors of a class "PuzzleBlockGrid" in my level blueprint. This worked in 4.17, but in 4.20, although the previously set array elements have stayed, I can't add more actors; the new elements stubbornly remain blank. The dropdown and pick tool are greyed out, and mouseover shows this: "Editing this value in a Class Default Object not allowed?" alt text I also tested with a single valued variable, and it's the same.

Is this a bug, or deliberate, and if yes, what's the recommended way now in 4.20?

Product Version: UE 4.20
picture2.png (833.4 kB)
more ▼

asked Jul 29 '18 at 05:53 PM in Blueprint Scripting

avatar image

16 1 2 4

avatar image tanmayb Jul 30 '18 at 07:30 PM

Here are the things I tried: 1) Make a new array in the same level for the same actor BP. Didn't work. 2) Make a new array in the same level for a different test actor BP. Nope. 3) Make a new project, a new array in the level and a new test actor BP. Still the same.

I'm not sure what I'm missing. Does it work for other people? It should be right? A friend of mine also has the exact same issue, which was actually where I noticed it first.

Is this a bug?

avatar image iamshaneihaveaface Aug 21 '18 at 03:17 PM

This is also happening to us on 4.20.1. I think it was an oversight to this issue: https://issues.unrealengine.com/issue/UE-60132

avatar image sclark39 Aug 21 '18 at 03:28 PM

UE-60132 claims this is by design:

Going forward with 4.20 you will only be able to set actor references on an instance of a Blueprint in a level, but not in the class defaults of a Blueprint.

...but it seems like this must be an oversight, since there's no instance to edit way to edit in the level, for level blueprints.

Similar question, for level blueprints specifically: https://answers.unrealengine.com/questions/810267/view.html

avatar image tanmayb Aug 23 '18 at 02:10 PM

So the only to do that now is to makeArray on BeingPlay? (as also pointed out in the linked answer above)

avatar image sclark39 Aug 23 '18 at 03:33 PM

Yes, if you want the array in the level blueprint itself set... Or you could potentially create a proxy actor to place in the world and add an array variable to that instead. That way the interface would be similar for setting up the references, and in the level blueprint you'd just pull the variables off that actor instance instead of from the level blueprint's variables.

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

3 answers: sort voted first

Your variable type is object, it needs to be class. Object means an instance, but since a Blueprint is a class an not yet an instance, it can't reference objects, only other classes.

Set it to Class Reference, recompile and you should be able to define the array now

alt text

more ▼

answered Oct 11 '18 at 08:29 PM

avatar image

6 1 3

avatar image sclark39 Oct 11 '18 at 10:43 PM

This does not accomplish the desired outcome. The issue is that this is not just any class blueprint, it's a level blueprint. Since there is no instance of the class in editor to click on, this is like having both the class and instance all in one. Effectively a blueprint singleton. And since there is no instance of the class in the editor to edit, the only way to edit these values is on the class defaults which, prior to UE 4.20, worked fine.

avatar image somenzguy Oct 15 '18 at 08:25 PM

I tested the Level Blueprint, it works as I described. If the OP tanmayb changed the variable type to a class type, they might lose the populated fields, but it seems like they will be able to repopulate them. alt text

avatar image sclark39 Oct 15 '18 at 09:46 PM

Yes, it is editable... but it is not accomplishing the same thing. The intention is to be able to populate the array with references to instances that exist in the level, not the type of class they are.

avatar image somenzguy Oct 16 '18 at 01:13 AM

Oh I thought the OP was after classes, not instances. Yeah I guess that doesn't work then

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

After having made the child class of my blueprints, all worked well; until today. I added a second instance of the child class BP to my level and it would not allow any reference to be made (editing this value) to the variable that is set to type object (a specific BP). After working with this for a few hours, I changed the variable type to soft object and that seems to have solved the problem. I did have to edit the existing blueprints to re-link the variables in my scripts and UE4 automatically added a conversion node to convert the reference from a soft object to a regular object.

At the moment, all is working as expected for my level. This is simple direct blueprint communications; one blueprint getting a reference to another.

more ▼

answered Oct 12 '18 at 04:06 PM

avatar image

6 1 2

avatar image sclark39 Oct 15 '18 at 09:52 PM

This seems like it must be the intended way to do this now. I am upvoting this answer.

I believe with this you will need to be careful to not use the reference too soon after streaming in the level, if it is a streamed level. The reference may be invalid if used in BeginPlay.

avatar image sclark39 Nov 14 '18 at 08:50 PM

Warning!!! Using Soft References can actually cause issues when playing from editor! (UE 4.20.3)

The soft reference apparently can link to the "editor world" version of an actor instead of the "pie world" version. We ran into this when trying to call UGameplayStatics::GetPlayerPawn( GetWorld(), 0 ) from the soft referenced actor. GetWorld returned was the Editor version, so no PlayerPawn could be found!

avatar image Burgess Nov 15 '18 at 09:24 PM

Wow, thanks for the head's up. I have moved on to other things at the moment but I will be sure to address this when I get back to that part of my project.

Thanks again for your insight.

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

Make both blueprints child class.

more ▼

answered Oct 07 '18 at 03:05 PM

avatar image

6 1 2

(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