Hello
In simple words, my aim is to simply change USkeletalMeshComponent into UPoseableMeshComponent. I need it to do in C++, not in BP.
Here I use First Person C++ Template and change code of
MyProjectCharacter.h file:
class AMyProjectCharacter : public ACharacter
{
GENERATED_BODY()
/** Pawn mesh: 1st person view (arms; seen only by self) */
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
class USkeletalMeshComponent* Mesh1P;
(...)
public:
/** Returns Mesh1P subobject **/
FORCEINLINE class USkeletalMeshComponent* GetMesh1P() const { return Mesh1P; }
(...)
}
into:
class AMyProjectCharacter : public ACharacter
{
GENERATED_BODY()
/** Pawn mesh: 1st person view (arms; seen only by self) */
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
class UPoseableMeshComponent* Mesh1P;
(...)
public:
/** Returns Mesh1P subobject **/
FORCEINLINE class UPoseableMeshComponent* GetMesh1P() const { return Mesh1P; }
(...)
}
and MyProjectCharacter.cpp file:
AMyProjectCharacter::AMyProjectCharacter()
{
(...)
// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)
Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));
(...)
}
into:
AMyProjectCharacter::AMyProjectCharacter()
{
(...)
// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)
Mesh1P = CreateDefaultSubobject<UPoseableMeshComponent>(TEXT("CharacterMesh1P"));
(...)
}
Unfortunately it’s not as simple as it might seem. That modification creates errors, that I can’t solve with my knowledge.
I’ll be very grateful for your help.