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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Why cant it read from reference object variable?

Why cant it read from the reference object variable of inventory that is inside my thirdpersoncharacter it reads it as null.. and i cant get it to use that object due that it reads it as null how to set it? isnt there like a default constructor or smth?... please help guys i really need to know how to fix it.

alt text

Product Version: UE 4.16
adding-to-array.png (331.2 kB)
more ▼

asked Aug 28 '17 at 07:17 AM in Blueprint Scripting

avatar image

3 1 2

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

1 answer: sort voted first

From what I see here I think it's because you didn't have an 'Inventory' for it to reference. The way you set it looks like an object, not a data structure, so it won't automatically set to a default value at the start, like an integer or vector; and I didn't saw it in your Character hierarchy. If you want to fix it, either delete the one in your variable then drag one from your content browser to your character; Or spawn one in the character's construct script then sign that to the variable.

more ▼

answered Aug 28 '17 at 07:35 AM

avatar image

55 8 12 16

avatar image Arshavin Aug 28 '17 at 01:23 PM

Thanks alot, it helped me alot but can i ask smth? cant i have a class blueprint that only carries data and then use it as a variable to store data in it without having to set it to an actor? some people saying use structs but is there way to use classes?

avatar image Nachtmahr Aug 28 '17 at 02:03 PM

learn how to properly communicate than you never run into problems like this. This Video might help you: https://www.youtube.com/watch?v=EM_HYqQdToE

As for Classes they are Objects and you can have hundrets of them you have to refference a specific Instance, by default any Object variable is Empty until you set it. Structs and other premitive types are Value Types, you can look at them as raw data and it can´t be Empty. Note: Objects types inside structs will still be empty but the struct itself never =)

avatar image Arshavin Aug 28 '17 at 05:53 PM

Thanks, i will watch the video and take structs in mind then see what i can do thanks alot for your help you cleared it out to me.

(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