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] Accessing Blueprint properties wihout spawning


If I want to read properties of an object that are declared in a C++ class, but set in Blueprint, is there a way to do it without spawning ? In Unrealscript, defaultproperties could be accessed statically, I wonder os such a thing exists in UE4.

Like if you want a weapon choice menu, you need to display the weapon's properties, but actually spawning the weapon could be an issue.

Thanks !

Product Version: Not Selected
more ▼

asked Apr 11 '14 at 06:32 AM in C++ Programming

avatar image

594 55 64 133

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

The question has been closed Apr 28 '15 at 07:44 AM by StrangerGwenn for the following reason:

The question is answered, right answer was accepted

1 answer: sort voted first

Yeah, you can use the same general method as UE3. Here's some example code using the DefaultPawnClass that's defined in GameMode:

 UPROPERTY(EditAnywhere, noclear, BlueprintReadWrite, Category=GameMode)
 TSubclassOf<class APawn>  DefaultPawnClass;
 APawn* DefaultPawn = DefaultPawnClass->GetDefaultObject<APawn>();

This is a bit unsafe (you could modify the object at this point and cause issues) so it's not exposed to blueprints, but you can do it from C++ as needed.

more ▼

answered Apr 11 '14 at 10:38 PM

avatar image

[Epic]Ben Zeigler STAFF
1.3k 30 131 75

(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