x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

USpringArmComponent & UCameraComponent undefined

Hi, I'm new to Unreal but have experience programming in C++ which is why I started to follow the tutorials listed here. However when following this tutorial I'm having problems declaring the spring arm and camera components for the pawn class with the intelisense claiming these are undefined even though I'm following word for word the tutorial. Is there something I'm missing with this? alt text

 #pragma once
 
 #include "CoreMinimal.h"
 #include "GameFramework/Pawn.h"
 #include "PawnwithCamera.generated.h"
 
 UCLASS()
 class RTS_API APawnwithCamera : public APawn
 {
     GENERATED_BODY()
 
 public:
     // Sets default values for this pawn's properties
     APawnwithCamera();
 
 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;
 
 protected:
     UPROPERTY(EditAnywhere)
     USpringArmComponent* cameraSpringArm;
     UCameraComponent* camera;
     
 };

Product Version: UE 4.16
Tags:
unreal.png (23.1 kB)
more ▼

asked Jul 07 '17 at 04:44 PM in C++ Programming

avatar image

bl4ckh4wk99
11 1 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

I believe it is just because you haven't mentioned them as a class it should read

 class UCameraComponent* camera;

instead of

 UCameraComponent* camera;


if it isn't that please make sure you're actually including:

 #include "Camera/CameraComponent.h"

more ▼

answered Aug 18 '17 at 04:41 PM

avatar image

Kardaras
57 3 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey, can you make sure you understand this post and report back if you have more questions? <3

more ▼

answered Jul 07 '17 at 05:02 PM

avatar image

Ninjin
4.2k 88 38 152

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

For anyone who would still like an answer to this question, make sure to include the header file for the Spring Arm and Camera components.

 #include "Classes/GameFramework/SpringArmComponent.h"
 
 #include "Classes/Camera/CameraComponent.h"
 




more ▼

answered Mar 04 '19 at 10:45 PM

avatar image

uventprojects
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question