Porting/Updating camera shake

Hey, so I have a project that was made in UE4.25 and I am now planning to update it to ue5 (but the issue also pertains to 4.26, as that was when the change was made).

So I realize that Camera/Camerashake.u is now MatineeCameraShake.u

I have redone the old references to classes to refer to the new engine classes, I have also replaced the PlayCameraShake function with StartCameraShake instead. However, I can’t seem to get my project to compile with the new references.


// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "MatineeCameraShake.h"
#include "WSCameraShake.generated.h"

/**
 * 
 */
UCLASS()
class WINSTICK_API UWSCameraShake : public UMatineeCameraShake
{
	GENERATED_BODY()
	
public:
	// Sets default values for this actor's properties
	UWSCameraShake();

};

I get an error that it cannot open or find the file MatineeCamerashake, despite being identical to another project that I have already ported to UE5 and created a new camerashake class within.

I am also getting an error that TSubclassOf<UMatineeCameraShake> CamShake;
"is not a valid template type argument for parameter ‘TClass’ Winstick X:\Unreal\Unreal Projects\Winstick 5.0\Source\Winstick\WSPlayer.h 94 "

What am I missing?

Having the same issue in 4.27. Getting this error.

cannot open source file “MatineeCameraShake.h”

Tried including the Module GameplayCameras, but no luck.

I don’t know if this works or not but it may help:
unrealcpp/CameraShake at master · Harrison1/unrealcpp (github.com)

I don’t remember what I did as it’s been a while, but I was able to fix it.

I think I ended up recreating the new classes from scratch and scrapping the old ones, even though as far as I could tell they were identical. One worked and one didn’t.

You need to ensure that “GameplayCameras” plugin is enabled in your uproject file:

	"Plugins": [
		{
			"Name": "GameplayCameras",
			"Enabled": true
		}
	]

…and included as a dependency in your .build.cs file:

		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"GameplayCameras"
			}
		);
1 Like