Why do we have to create pointers for U and A prefixed classes and non pointers for F prefixed structs?

The short answer is: because that’s the way Unreal works.

The longer answer is that one of the points of the Engine is to manage objects for you and to do that it needs to be hooked into the creation of any UObjects (AActors are a subset of these). On the other hand, the engine supports structures as strictly value types and therefore doesn’t have to do anything special when one is created. This means to can declare instances of structures directly, whereas for Objects or Actors you have to call NewObject or SpawnActor. Since those two functions return pointers, you’ll never have an instance of those types by value.

4 Likes