UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"blueprint class for a character that can jump, move and animate in a 3D platformer"
// Create a CapsuleComponent for collision CapsuleComponent = CreateDefaultSubobject<UCapsuleComponent>(TEXT("CapsuleComponent")); CapsuleComponent->InitCapsuleSize(42.f, 96.0f); CapsuleComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics); CapsuleComponent->SetCollisionResponseToAllChannels(ECR_Block); CapsuleComponent->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap); CapsuleComponent->SetCollisionResponseToChannel(COLLISION_PROJECTILE, ECR_Block); CapsuleComponent->SetCollisionResponseToChannel(COLLISION_WEAPON, ECR_Block); CapsuleComponent->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block); CapsuleComponent->SetupAttachment(GetMesh(), NAME_None); // Add OnLanded event to the capsule component CapsuleComponent->OnComponentHit.AddDynamic(this, &ACharacter::OnLanded);