Why is PlayerStart colliding with BSP or landscape, but not with a Plane?

I have a PlayerStart that spawns an actor. Every time it will complain about collisions and refuse to spawn the pawn if it is above a landscape or a geometry brush.

LogSpawn: Warning: SpawnActor failed because of collision at the spawn location [X=0.000 Y=0.000 Z=600.000] for [AvaCameraCharacter]
LogGameMode: Warning: SpawnDefaultPawnAtTransform: Couldn't spawn Pawn of type AvaCameraCharacter at Rotation: Pitch 0.000000 Yaw 0.000000 Roll 0.000000
Translation: 0.000000 0.000000 600.000000
Scale3D: 1.000000 1.000000 1.000000

It’s clearly not colliding with anything. I can’t see anything when “Show Collisions” is on. Changing the floor to a Plane makes it work. Why?

Hello Galkowskit,

My first thought is that maybe there is something really large in your pawn. (Can you reproduce this with a pawn/character from the first or third person templates?)

A workaround could be changing ‘Spawn Collision Handling Method’ in your player start. But then the mystery of what’s overlapping would still remain. :mag:

It’s best practice to use GameModes (pets PlayerController class on head) but you could also try dragging your pawn/character into the world and set it to Autopossess player 0

Let us know if any of those help!

Yeah, I can get it to work by just placing the pawn in there, that’s fine. I’m just wondering what the hell is happening. :stuck_out_tongue:

#include "AvaCameraCharacter.h"
#include "GameFramework/SpringArmComponent.h"
#include "Camera/CameraComponent.h"

AAvaCameraCharacter::AAvaCameraCharacter()
{
	PrimaryActorTick.bCanEverTick = true;
	
	// Create components.
	RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootSceneComponent"));
	SpringArmComp = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArmComponent"));
	CameraComp = CreateDefaultSubobject<UCameraComponent>(TEXT("CameraComponent"));

	// Attach components.
	SpringArmComp->SetupAttachment(RootComponent);
	CameraComp->SetupAttachment(SpringArmComp, USpringArmComponent::SocketName);

	// Assign SpringArm class variables.
	SpringArmComp->SetRelativeLocationAndRotation(FVector(0.f, 0.f, 50.f), FRotator(-60.f, 0.f, 0.f));
	SpringArmComp->TargetArmLength = 1200.f;
	SpringArmComp->bEnableCameraLag = true;
	SpringArmComp->CameraLagSpeed = 3.f;
}

void AAvaCameraCharacter::BeginPlay()
{
	Super::BeginPlay();
}

void AAvaCameraCharacter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
}

void AAvaCameraCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);
}

This is the entirety of the pawn code. The only thing that is being added there is a SpringArmComponent and a CameraComponent.

And here is the GameMode:

#include "Ava/Game/AvaGameMode.h"
#include "AvaPlayerController.h"
#include "AvaCameraCharacter.h"

AAvaGameMode::AAvaGameMode()
{
	PlayerControllerClass = AAvaPlayerController::StaticClass();
	DefaultPawnClass = AAvaCameraCharacter::StaticClass();
}

PS: Collision settings on Player Start don’t seem to do anything.

The scene itself is very empty and it works when using a Plane as a floor but not when using Geometry Brushes or Landscape.

image

And the GameMode is selected in the Project Settings.

Ah! I found it. It seems (for some reason, that is still unknown to me) this line:

	RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootSceneComponent"));

Was the culprit. I removed it and used the default RootComponent instead and it worked. I guess the USceneComponent must’ve used a world position of FVector(0, 0,0) or something. Works now. :slight_smile:

1 Like