I have a custom Pawn whose header file is this:
UCLASS()
class ORLANDO_API AC_MyPawn : public APawn
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MyPawn")
UStaticMeshComponent * MyStaticMesh;
// Sets default values for this pawn's properties
AC_MyPawn (const FObjectInitializer &ObjectInitializer);
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
// override the event hit as that seems really slow in the blueprints
virtual void NotifyHit(class UPrimitiveComponent* MyComp, AActor* Other, class UPrimitiveComponent* OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult& Hit) override;
virtual bool CanEditSimulatePhysics()
{
return true;
}
};
The .cpp is very simple:
// Sets default values
AC_MyPawn::AC_MyPawn(const FObjectInitializer &ObjectInitializer)
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
// Set my static mesh to the root component
MyStaticMesh = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("StaticMesh"));
RootComponent = MyStaticMesh;
}
I create a blue print from this, however when I look at it in the editor there seems to be no part to the physics. I can’t set simulate or not, overload mass etc it’s all blank. How can I create a class which I can then edit as a blueprint in the editor?