Problem with referencing a Child in another Blueprint

It’s right here:

image

So:

Cast to whatever type the Main Weapon is, same as in here:


the issue we’re talking about is the reason for that runtime error.

The issue stems from the Main Weapon variable having no value - this reference is not pointing at any specific object. The above script asks the Child Actor Component for its actor, and assigns it to the Main Weapon variable, so it’s easier to use later on by fetching a single node rather than casting every time.

In short: the editor does not know what Main Weapon refers to; it’s your job to populate variables with pertinent values. Imagine if you created a String variable but forgot to type the text. You do have a variable but it is empty.

1 Like