noob cpp questions

Sphere1->SetupAttachment(RootComponent);

is the sphere a child of rootcomponent ot what does this do exactly

PointLight1 = CreateDefaultSubobject<UPointLightComponent>(TEXT("PointLight1"));

whats the TEXT for?

Sphere1 = CreateDefaultSubobject<USphereComponent>(this, TEXT("Sphere1"));

why doo whe need this here?

if (OtherActor != this)

does this means if we are the player will it enter the if?

  1. USceneComponent::SetupAttachment | Unreal Engine 5.2 Documentation

  2. TEXT Properties | Unreal Engine Documentation

  3. THIS is a pointer: The this pointer - cppreference.com

  4. OtherActor is a reference to another class.
    IF it is Not Equal To some Pointer → do something.

thanks i get it. we are attaching the sphere to the root at 1 right?

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