I spawn an actor and want to get a reference to self, aka the actor that spawned it. I’ve set up a variable with the correct type and it worked fine, till today. When I started the editor the self node was disconnected and trying to reconnect fails with ‘self reference is not compatible with xy reference’. Then i promoted self to a variable, but trying to connect that variable to the other node fails as well, this time with ‘xy reference is not compatible with xy reference’. How can something of the same reference type be incompatible??
I read somewhere today that it might not be possible to use a variable of the same type as the Blueprint containing it because by the time the Blueprint is trying to compile the variable, the Blueprint itself is still uncompiled. I think that comment referred to an older version (4.7 or older) but that might be what you’re seeing here.
Still, that doesn’t answer why it didn’t work without a variable. Can you upload a screenshot showing how you’re passing the reference to “self” to the spawned actor?
Depending on what you’re trying to do, you could flag the variable as “Expose on Spawn” and pass self directly into the SpawnActor node.
I’ve tried both. First i spawned the actor, took the return value as target and set the variable (which was working for a while), taking self as the value for the variable. Then i exposed the variable on spawn and tried to set it there, but no can do…