Is Cast To StaticMeshActor inherently a bad idea?

Ok so i get that the Cast To node creates a hard reference and this can be bad practice. I was wondering if it is the same if i Cast To StaticMeshActor, since that one is practically in any level anyways. Also is it possible to connect the StaticMeshActor via BlueprintInterface to get around using the Cast To node?

We usually used cast to StaticMeshActor in BeginOverlap to check if the Actor is a StaticMesh. But it will inherit function/properties of StaticMeshActor like getLocation but not a specific class instance. It like a generic class.

image

Am not sure about your 2nd question, but yes you can add a parameter as StaticMeshActor in your function interface.

1 Like