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"

Variable Values for C++ and Blueprint

I understand the order of event for the game is C++ Constructor -> BP Constructor then C++ BeginPlay() -> BP BeginPlay().

Currently, I have variables in C++ which are marked EditDefaultsOnly and exposed to BP. If I set those values in BP but try and access them in the C++ constructor, it returns the initial value set in C++ (such as nullptr) NOT what was set in BP.

Right now I am trying to create / use UDataTable but the row name is set in BP (initialized in C++ as " ") and it never finds the row (UE_LOG shows it trying to find the row with ID " " ).​

When are the values set in BP readable in C++?

Product Version: UE 4.14
Tags:
more ▼

asked Mar 30 '17 at 03:01 PM in C++ Programming

avatar image

Cetaurefie
11 3 4 6

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

1 answer: sort voted first

Hey Cetaurefie-

As you mentioned, the C++ constructor runs before blueprint construction. If you're setting something inside the blueprint, the C++ constructor won't know what is being set. You can try the PostEditChangedProperty() function as this is called when an actor is created / updated in the editor. Your best bet for ensuring that what is set in the blueprint is accessible in C++ would be to access the value in the C++ BeingPlay() function.

Cheers

Doug Wilson

more ▼

answered Mar 30 '17 at 03:29 PM

avatar image Cetaurefie Mar 30 '17 at 03:44 PM

I thought as much. I was trying to set the mesh of an actor from the datatable, but since its calling from in beginplay() it never shows the mesh when placed inside the editor. Is there a way around that? I'm just setting the mesh in BP instead of from the datatable for now.

(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