Salty.uproject (UE 5.8) from the Third Person template with class redirects, the SaltyCore and Salty modules, the three build targets, USaltyAssetManager calling InitGlobalData, Config/Tags with the 23 root namespaces, Scripts/run-tests.sh, build.sh and Authoring/create_gym.py, L_Gym, Git LFS attributes and the placeholder test. Template variants kept as reference (D-41). The four Fab packs stay out of the repository for now (~10 GB). The editor serves the engine MCP plugin on 127.0.0.1:8000 through DefaultEditorPerProjectUserSettings.ini. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
47 lines
1.5 KiB
C++
47 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
#include "SideScrollingJumpPad.h"
|
|
#include "Components/BoxComponent.h"
|
|
#include "GameFramework/Character.h"
|
|
#include "GameFramework/CharacterMovementComponent.h"
|
|
#include "Components/SceneComponent.h"
|
|
|
|
ASideScrollingJumpPad::ASideScrollingJumpPad()
|
|
{
|
|
PrimaryActorTick.bCanEverTick = false;
|
|
|
|
// create the root comp
|
|
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
|
|
|
|
// create the bounding box
|
|
Box = CreateDefaultSubobject<UBoxComponent>(TEXT("Box"));
|
|
Box->SetupAttachment(RootComponent);
|
|
|
|
// configure the bounding box
|
|
Box->SetBoxExtent(FVector(115.0f, 90.0f, 20.0f), false);
|
|
Box->SetRelativeLocation(FVector(0.0f, 0.0f, 16.0f));
|
|
|
|
Box->SetCollisionObjectType(ECC_WorldDynamic);
|
|
Box->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
|
|
Box->SetCollisionResponseToAllChannels(ECR_Ignore);
|
|
Box->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
|
|
|
// add the overlap handler
|
|
OnActorBeginOverlap.AddDynamic(this, &ASideScrollingJumpPad::BeginOverlap);
|
|
}
|
|
|
|
void ASideScrollingJumpPad::BeginOverlap(AActor* OverlappedActor, AActor* OtherActor)
|
|
{
|
|
// were we overlapped by a character?
|
|
if (ACharacter* OverlappingCharacter = Cast<ACharacter>(OtherActor))
|
|
{
|
|
// force the character to jump
|
|
OverlappingCharacter->Jump();
|
|
|
|
// launch the character to override its vertical velocity
|
|
FVector LaunchVelocity = FVector::UpVector * ZStrength;
|
|
OverlappingCharacter->LaunchCharacter(LaunchVelocity, false, true);
|
|
}
|
|
}
|