Why is "cast to" node as big in size as my solo BPI Interface without the "cast to.." node in an empty BP ?

I tried to avoid casting to my player character by creating an Interface for it. It turns out that in an new and empty “test” BP only containing the BPI Interface to be exactly as big in size as the cast to node (8.1gb in my case). So first i placed only the “cast to” node in there and checked 8.1 gb. Then i deleted it and put the Interface in there and the “Size map” shows still 8,1gb. Am i doing it wrong ?

Both shows the same result somehow :face_with_raised_eyebrow:

I can actually even delete everything in there and just add the Interface alone and the BP is still 8.1gb

get sure to delete all your functions, recompile and save. then check the size map again.

now if you add the interface method, there are likely two versions, one for the method on your character class, and another generic one, which you can distinguish by the yellow target pin. that’s the node that you likely want to use.

anyways… for a player character there’s no reason to avoid a hard reference and use casting if it’s loaded all the time anyways.

There are no functions in there. This was basicly a fresh made BP just for testing. Going to “class defaults” and adding the interface alone make the BP size go up to 8.1 gb somehow.. But ok if player character is aways loaded then it wouldn’t make any difference to replace all the casting nodes with an extra Interface. Acctually good to know thx.

just noticed that there was a interface implementation in your test blueprint, which shouldn’t be there (the last screenshot)

and noticed that the method returns a reference (likely of your player class), which alone already is enough to cause a hard reference.

interface methods are for generic actions, not to make getters for specific types

1 Like

Yeah i tested both without adding the interface and after adding it. That was the point of it to see if this interface instead of casting will save me some size. But it didn’t. Must be the hard reference you mention happening with the interface then. I guess i will have to do an interface not referencing the whole player character but only some individual variables from him to get it work. I guess case closed for now thx