Issue with Unreal Engine 5.1 with M1 MacBook pro - c++

I am having trouble adding the libraries for the unreal 5.1 engine to this .h file with the following code. I have uninstalled my C/C++ extension C# extension to no avail. Unsure what the fix is.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "PrintMessage.generated.h"
UCLASS()
class FIRSTUNREALSCRIPT_API APrintMessage : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
APrintMessage();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};
I tried to read through the UE 5.1 vscode documentation.

Related

Getting unknown function specifier "BluePrintImplementableEvent" error while compiling my C++ code

I am using UnrealEngine 4.27.2. While Compiling my C++ code i am getting this error " Unknown function specifier "BluePrintImplementableEvent" after creating a UFUNCTION.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "damageableActor.generated.h"
UCLASS()
class BASICS_API AdamageableActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AdamageableActor();
UFUNCTION(BlueprintImplementableEvent, Category = "Damage")
void onTakeAttack();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
void takeAttack();
};

How to rotate bones in UE4 with C++?

I just want to create a node that simply specifies the bone name of the character and rotates it.
I want to move multiple bones, not just one bone, using the naming method.
I wrote the following codes.
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;
};
When I compile the above code and open it with a level blueprint, I see a node like the one in the figure below.
This node is not what I wanted.
I want to create a node that can connect to FinalAnimationPose as shown in the image below.
How can I create a node like this?
All I want to do is simply rotate the bones every second. I couldn't find this information.
I am a beginner in both UE4 and C ++. Any answer will help.
I am new to UE but I think it was the same question which was asked in UE community to rotate but it was for a single bone:
Here's the link to that: https://answers.unrealengine.com/questions/47930/how-to-rotate-bone-in-c.html

UNREAL ENGINE V4.21: Components not being initialized during constructor call for Character

We tried to initialize components inside our character's constructor. The code worked on v4.15 but not v4.21.
Here is our code (.h file and .cpp file respectively):
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MainCharacter.generated.h"
UCLASS()
class VRET_API AMainCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AMainCharacter();
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:
UPROPERTY()
class UCameraComponent * camera;
UPROPERTY()
class USceneComponent * VRroot;
};
#include "MainCharacter.h"
#include "Camera/CameraComponent.h"
#include "MotionControllerComponent.h"
#include "Runtime/Engine/Classes/Components/StaticMeshComponent.h"
#include "Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h"
// Sets default values
AMainCharacter::AMainCharacter()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
VRroot = CreateDefaultSubobject<USceneComponent>(TEXT("VRroot"));
VRroot->SetupAttachment(GetRootComponent());
camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
camera->SetupAttachment(VRroot);
}
The code compiles, but when we run the game our character's components aren't being initialized and we cannot find them in the editor during gameplay BUT the default character components (eg:capsule component) work and show properly.
This happened to me. Try to unparent your blueprint class from AMainCharacter to just ACharacter, and then again parent it from AMainCharacter.
It worked for me!

Unreal Engine 4: UShapeComponent gives the error 'identifier is undefined'. What can I do?

I am using Unreal 4.18 and Visual Studio 2017. Using certain class like UShapeComponent, UBoxComponent, USphereComponent gives identifier is undefined error while likes of USceneComponent, UStaticMeshComponent works just fine. What's wrong?
Here is my code:
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"
UCLASS()
class UNREALTUROIAL_API AMyActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AMyActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
UPROPERTY(EditAnywhere)
UStaticMeshComponent* PickUpMesh;
UPROPERTY(EditAnywhere)
UShapeComponent* PickUpBox;
UPROPERTY(EditAnywhere)
USceneComponent* PickUpRoot;
};
enter code hereYou can try adding this include to your .h file
#include <Runtime/Engine/Classes/Components/SphereComponent.h>

"plugin verification data mismatch" while loading plugin for qt5 project

I have raw (no QtDesigner) Qt5 project with two simple plugins, which one don't load with laconic error: "plugin verification data mismatch".
Header of first plugin (which loads and run well):
#ifndef __PIROGRONIAN__P2P2__GUI_PLUGIN__H__
#define __PIROGRONIAN__P2P2__GUI_PLUGIN__H__
#include "QtCore/QtCore"
#include "PluginInterface.h"
namespace P2P2 {
class GuiPlugin : public QObject, public PluginInterface {
Q_OBJECT
Q_PLUGIN_METADATA(IID "Pirogronian.P2P2.GuiPlugin")
Q_INTERFACES(P2P2::PluginInterface)
public:
bool init(CoreServer *);
bool receiveObject(Object*);
int channelType();
};
};
#endif
The second one, which don't load:
#ifndef __PIROGRONIAN__P2P2__CHAT_PLUGIN__H__
#define __PIROGRONIAN__P2P2__CHAT_PLUGIN__H__
#include <QtNetwork/QtNetwork>
#include "Chat.h"
#include "PluginInterface.h"
namespace P2P2 {
class ChatPlugin : public QObject, public PluginInterface {
Q_OBJECT
Q_PLUGIN_METADATA(IID "Pirogronian.P2P2.ChatPlugin")
Q_INTERFACES(P2P2::PluginInterface)
CoreServer *_server;
QHash<Channel *, Chat *> _chats;
public:
virtual bool init(CoreServer *);
virtual bool receiveObject(Object *);
virtual int channelType();
};
};
//Q_DECLARE_METATYPE(QPointer<P2P2::ChatPlugin>)
#endif
Here is PluginInterface header:
#ifndef __PIROGRONIAN__P2P2__PLUGIN_INTERFACE__H__
#define __PIROGRONIAN__P2P2__PLUGIN_INTERFACE__H__
#include "CoreServer.h"
namespace P2P2 {
class PluginInterface {
public:
virtual bool init(CoreServer *) = 0;
virtual bool receiveObject(Object *) = 0;
virtual int channelType() = 0;
};
};
Q_DECLARE_INTERFACE(P2P2::PluginInterface, "Pirogronian/P2P2/PluginInterface/1.0")
#endif
I'm not expert and writing plugins for qt5 is described very cursorily. But since I can't find any major difference between those plugins, problem becomes rather mysterious to me. Mayby a bug in Qt? I've rebuilt both several times to bye sure that both are up to date.
I'm trying put the whole code somewhere into net, but it'll take a while... Edit: done - packed as zip here: http://uploaduj.net/D74c2f/v0-1-pure-zip/
Not sure if it helps but it seems that your plugin has invalid metadata. Here's code that sets error message http://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/plugin/qlibrary.cpp#n303
You could use debug version of Qt and set breakpoint in that function. This would give you exact line that fails while loading your plugin.
Maybe you have an error in your metadata?