DrFolamour
(Dr Folamour)
November 16, 2019, 4:24pm
1
Hi folks i’m new to unreal i’m doing the C++ tutorial from here :
https://docs.unrealengine.com/en-US/…2/7/index.html
All work fin until the code set the camera in the class, here there is an error, i got the FULLY copied source from the tutorial
here is the error :
UPROPERTY(VisibleAnywhere)
UCameraComponent* FPSCameraComponent;
hope you can help,
thanks,
f.
GarnerP57
(GarnerP57)
November 16, 2019, 4:53pm
2
You didn’t write what the error is? Is it that UCamerComponent is undefined?
make a forward declaration to UCameraComponent by appending class like this
UPROPERTY(VisibleAnywhere)
class UCameraComponent* FPSCameraComponent;
DrFolamour
(Dr Folamour)
November 16, 2019, 5:22pm
3
Hi Garner i’ll managed to fix the problem with including :
#include “UObject/ObjectMacros.h”
#include “UObject/ScriptInterface.h”
#include “Components/SceneComponent.h”
#include “Engine/BlendableInterface.h”
#include “Engine/Scene.h”
#include “Camera/CameraTypes.h”
#include “Camera/CameraComponent.h”
#include “Components/SceneComponent.h”
#include “GameFramework/Character.h”
#include “FPSCharacter.generated.h”
Now i have an error on :
FPSCameraComponent->SetupAttachment(GetCapsuleComponent());
error C2664: ‘void USceneComponent::SetupAttachment(USceneComponent *,FName)’: cannot convert argument 1 from ‘UCapsuleComponent *’ to ‘USceneComponent *’
TIPS : Visual assist told me that UsceneComponent is incompatible with UCapsuleComponent
Hope you can help, i really want to dig this engine, did you know some good C++ tutorial for UE 23.1 ?
DrFolamour
(Dr Folamour)
November 16, 2019, 5:38pm
4
ok i’ve found you have to include
#include “Components/CapsuleComponent.h”
Thanks all ; =)
Please how to set thread as “resolved” ? seeked on the web dont found
Rainoxer
(Rainoxer)
February 11, 2020, 3:52am
6
I had exactly the same problem. The lesson 2.7 - Changing the Camera View | Unreal Engine Documentation is totally broken.
Hukgrip
(Hukgrip)
February 11, 2020, 10:05am
7
Dr Folamour:
ok i’ve found you have to include
include “Components/CapsuleComponent.h”
Thanks all ; =)
Please how to set thread as “resolved” ? seeked on the web dont found
This will always happen to you. Now you have to add the specific header of most types that you use in each cpp you make. Previously they used a header include that implicitly included many modules. Now you include what you need.