Hi, im very new to this engine, im trying to create a custom component that adds a USphereComponent to an actor so it can interact with the gravity of other objects.
This sphere component is created in a random position and i dont know why.
this is the code used:
collider = CreateDefaultSubobject<USphereComponent>(TEXT("GG Collider"));
collider->SetCollisionProfileName(TEXT("GGColider"));
collider->SetRelativeLocation(FVector(0, 0, 0));
collider->InitSphereRadius(1500.0f);
this is the result.
Am i doing something wrong?
EDIT:
SOVLED!
InitSphereRadius was moving the component.
switching both lines did the job
collider->InitSphereRadius(1500.0f);
collider->SetRelativeLocation(FVector(0, 0, 0));