Question about spawning projectiles

Excuse me asking this here, but I got a bad link to the correct “discussions” forum for tutorial 146 (Spawning Actors) and I thought this would be the next best place.

All the components in PawnBase.h use pointers e.g.

USceneComponent* ProjectileSpawnPoint;

but the variable we just added isn’t a pointer

TSubclassOf<AProjectileBase> ProjectileClass;
  • My first question is, what’s a better way of saying this than “isn’t a pointer”? I’m sure this has been covered many times, but what do we say when we’re accessing something directly?

  • The second question is, why do we not use a pointer here? I wondered if the reason had something to do with there being many possibilities of subclass that could go between the angled braces?

  1. non-pointer?
  2. Because It is basically a wrapper around one though e.g.
    template<class T>
    class TSubclassOf
        UClass* Class;
1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms