How can i make the Player Start Capsuel Movable

Screenshot 2022-12-29 220501
I can not edit it in the deatils panel and in i didnt find it in the c++ script
pls help me :confused:

APlayerStart is a child class of ANavigationObjectBase, and within ANavigationObjectBase.cpp there is this segment of code in its constructor:

ANavigationObjectBase::ANavigationObjectBase(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{
	CapsuleComponent = CreateDefaultSubobject<UCapsuleComponent>(TEXT("CollisionCapsule"));
	CapsuleComponent->ShapeColor = FColor(255, 138, 5, 255);
	CapsuleComponent->bDrawOnlyIfSelected = true;
	CapsuleComponent->InitCapsuleSize(50.0f, 50.0f);
	CapsuleComponent->SetCollisionProfileName(UCollisionProfile::NoCollision_ProfileName);
	CapsuleComponent->bShouldCollideWhenPlacing = true;
	CapsuleComponent->SetShouldUpdatePhysicsVolume(true);
	CapsuleComponent->Mobility = EComponentMobility::Static;

The final line, CapsuleComponent->Mobility = EComponentMobility::Static is the reason why its set to static.

What you can try to do is in the constructor of PlayerStart.cpp, add the line:

GetCapsuleComponent()->Mobility = EComponentMobility::Movable

Another option is to update the following code in NavigationObjectBase.h:

private:
	UPROPERTY(EditAnywhere, meta=(AllowPrivateAccess = "true"), Category="CapsuleComponent")
	TObjectPtr<class UCapsuleComponent> CapsuleComponent;

This will allow the following:

Now those properties are editable.

In all honesty, I am not sure why you need the capsule to be movable but these are a few methods to go about it. I hope it helps :slight_smile:

1 Like