Download

Transferring variable information between blueprints

Hey guys sorry if this has already been answered but I couldnt see it anywhere.

What im trying to do is transfer an objects coordinates contained in a variable from one blueprint (gun) to another blueprint (laser). Ive set the variables to public and created an interface so the two blueprints can communicate (Believe thats what interfaces are for) and set then in the class settings. Were im getting stuck is every time I bring a variable in getting errors of warnings so it doesnt work. Ive added screenshots if theres anything else you need to help me just ask and ill get the info.

Thanks
Mike

Note just tried it via a cast to gun and that never worked either gave me a warning that stopped it from working as well.

You are not gonna like it but if I were you I’d reserve 3h and: grab your favourite beverage and a cookie, head over to the documentation page and read up on Blueprint Communications:
Direct Communication
Interfaces
Event Dispatchers and This Thread
also
Casting
Those 3 hours spent now will save you 30 in the next month.

Now, to the point. For starters, in your 1st image you are casting a GameInstance as a *Gun *object. That will not work as they are completely different creatures.
Think about where in your code you Spawned (Gun object) from Class. Was it in the GameInstance?