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"

Where to set property values on newly added components

I made a new component, and set the default value of an integer uproperty to -1. What i want to do, is, when, in BP editor components tab, i add this component to the BP, the integer uproperty is set to Max of the same property across all the components of that type in the actor. I ONLY want this to happen in the editor, when the new component is added. I've tried OnComponentCreated, OnRegister, PostLoad, etc, but whereever i set the uproperty value, in the details panel it always shows up as -1. It's not a logic error, because even if it doesnt find an owning actor or any other components, it should still set it to 0.

tl;dr which method do i use to initialize default properties from a component ONLY in the editor AFTER it's been added to the actor ?

Product Version: Not Selected
Tags:
more ▼

asked Jan 07 '15 at 10:37 AM in C++ Programming

avatar image

rajkosto
188 23 31 144

avatar image rajkosto Jan 07 '15 at 04:16 PM

I think i know what I'm doing wrong, but see no solution to it: The details panel shows the properties of the template component object inside the UBlueprint itself, and that thing has no lifetime methods called on it like PostLoad or OnComponentCreated or OnRegister, so since my code was in those methods, it was setting the properties on the PREVIEW SPAWNED ACTOR'S RUNTIME COMPONENTS, which is not what the details panel is showing to me (instead, when the details panel is edited, the preview spawned actor's components are recreated).

How do i accomplish what i wanted ON the actual template component in the UBlueprint ?

avatar image ZenSzergely Sep 13 '18 at 05:09 PM

Any progress on this issue?

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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