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"

[Closed] Can't an UObject contain sub components?

Hi!

Can't an UObject contain sub components i.e. other UObject? When I try the following code the editor hangs before it starts up.

 Decal1 = PCIP.CreateDefaultSubobject<UDecalComponent>(this, "Decal1");
 Decal2 = PCIP.CreateDefaultSubobject<UDecalComponent>(this, "Decal2");

Declared as:

 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Decals)
 TSubobjectPtr<UDecalComponent> Decal1;

 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Decals)
 TSubobjectPtr<UDecalComponent> Decal2;

I get the following error messages:

 D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.3\Engine\Source\Runtime\CoreUObject\Private\UObject\CoreNative.cpp(146): Assertion failed: SubobjectOuter
 No corresponding destination object found for 'CustomDecalComponent /Script/RTSGame.Default__BaseStructure:Decal1' while attempting to instance component 'DecalComponent /Script/RTSGame.Default__BaseStructure:Decal1.Decal1'
 

Product Version: Not Selected
Tags:
more ▼

asked Jul 16 '14 at 04:39 PM in C++ Programming

avatar image

undercover
838 123 111 138

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

The question has been closed Jul 17 '14 at 07:46 AM by undercover for the following reason:

The question is answered, right answer was accepted


1 answer: sort voted first

No, components is Actor feature

more ▼

answered Jul 16 '14 at 05:10 PM

avatar image

Shadowriver
35.9k 929 169 1105

avatar image undercover Jul 16 '14 at 05:19 PM

Okay, thanks!

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

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question