Hello, I am new to C++ and would like to know how to code in a Launch Pad which includes a Cube for the platform and a hit collision box that when overlapped by the player launches them. I have previously been using blueprints.
Although vague, any help is appreciated!
In your launch pad class you would have to create an overlap function for your collisions.
header
UFUNCTION() void OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
cpp
BoxComponent->OnComponentBeginOverlap.AddUniqueDynamic(this, &AMyClass::OnOverlapBegin);
overlap function: AMyPawnClass* MyPawn = Cast(OtherActor);
FVector velocity = xxx; if (MyPawn) MyPawn->LaunchCharacter(velocity);