Hello! I’ve been following this tutorial and there’s a part that i have a problem with.
protected:
UPROPERTY(EditAnywhere)
class USpringArmComponent* OurCameraSpringArm;
class UCameraComponent* OurCamera;
I thought that the keyword class was only used for a class declaration or definition but here it looks like they’re using it to specify that USpringArmComponent is a class.(In case there was a variable of the same name i thought). I tried removing the keyword class at the beginning of both initialization to see if it would work but the code didn’t compile. I checked another tutorial and they have this piece of code.
UPROPERTY(VisibleDefaultsOnly, Category = Projectile)
USphereComponent* CollisionComponent;
I guess my question is : When is it necessary to use the keyword class other than for declaration and definition? Thank you.