我只想创建一个节点,它只是指定角色的骨骼名称并对其进行旋转。
我想使用命名方法移动多个骨骼,而不仅仅是一个骨骼。
我写了以下代码。
MyCharacter.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MyCharacter.generated.h"
class USkeletalMeshComponent;
class UPoseableMeshComponent;
UCLASS()
class TESTPLUGIN_API AMyCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AMyCharacter();
FRotator RotationValue;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
private:
UPoseableMeshComponent* PoseableMesh;
};
MyCharacter.cpp
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MyCharacter.generated.h"
class USkeletalMeshComponent;
class UPoseableMeshComponent;
UCLASS()
class TESTPLUGIN_API AMyCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AMyCharacter();
FRotator RotationValue;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
private:
UPoseableMeshComponent* PoseableMesh;
};
当我编译上面的代码并用关卡蓝图打开它时,我看到了一个如下图所示的节点。
这个节点不是我想要的。
我想创建一个可以连接到 FinalAnimationPose 的节点,如下图所示。
如何创建这样的节点?
我想要做的只是每秒旋转骨骼。我找不到此信息。
我是 UE4 和 C++ 的初学者。任何答案都会有所帮助。
答案 0 :(得分:0)
我是 UE 的新手,但我认为这是 UE 社区中要求旋转的同一问题,但它是针对单个骨骼的:
这是它的链接:https://answers.unrealengine.com/questions/47930/how-to-rotate-bone-in-c.html