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"

How do I make a UObject attached to an actor editable ?

I have a custom UObject structure that I have added to a Pawn class. I want to be able to see and edit the values of this custom UObject in blueprints when I view the BP of the Pawn. At the moment the best I can get is a reference to an object, which I have to rightclick->Edit.

Here is the relevant code for what I have atm:

----- PAWN CLASS ------- .h

 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = CustomStats)
 UModifiableStat* NewSpeed;


 APlayerPawnCombat::APlayerPawnCombat(const FObjectInitializer& ObjectInitializer)
     : Super(ObjectInitializer)
     NewSpeed = NewObject<UModifiableStat>();
     NewSpeed->BaseValue = 40.0;

---- Custom UObject class ----


 UCLASS(ClassGroup = (CustomStats), ShowCategories = (CustomStats))
 class SPACECOOP_API UModifiableStat : public UObject
     /*Base value for the stat, before any modifiers*/
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = CustomStats)
     float BaseValue;

and here's what I get in the editor :

alt text

What I would like is to have a drop-down expansion of the UObject in that panel so I can edit BaseValue. Is this possible?

Product Version: UE 4.7
uobject.png (7.2 kB)
more ▼

asked Jun 16 '15 at 04:00 AM in C++ Programming

avatar image

195 18 122 34

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

1 answer: sort voted first

The best I have come up with is to change it from a UObject to a STRUCT. Is this the only solution?


more ▼

answered Jun 16 '15 at 04:06 AM

avatar image

195 18 122 34

(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