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"

Strange Error after upgrading to 4.16

Hi I've just downloaded the 4.16 version and I was starting some testing but I got stuck with this simple lines of code:

I've created a BaseCharacter class based on ACharacter and I wanted to add a springarm, a camera and an arrow componenet but i got this error: alt text

this is the code I've wrote:

 #pragma once
 
 #include "CoreMinimal.h"
 #include "GameFramework/Character.h"
 #include "BaseCharacter.generated.h"
 
 UCLASS()
 class NOTANOTHERTRY_API ABaseCharacter : public ACharacter
 {
     GENERATED_BODY()
 
 public:
     // Sets default values for this character's properties
     ABaseCharacter();
 
 
 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;
 
     UPROPERTY(EditDefaultsOnly, Category = "Base Character")
         USpringArmComponent* SpringArm;
     UPROPERTY(VisibleAnywhere, Category = "Base Character")
         UCameraComponent * CameraComp;
     UPROPERTY(VisibleAnywhere, Category = "Base Character")
         UArrowComponent* TraceDirection;
 
 };
 

Does anyone could help me finding out what's going on ?

Product Version: UE 4.16
Tags:
immagine.png (166.0 kB)
more ▼

asked Jul 06 '17 at 05:13 PM in C++ Programming

avatar image

Levenlol
1 2 8 11

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

1 answer: sort voted first

Try this.

 UPROPERTY(EditDefaultsOnly, Category = "Base Character")
 class USpringArmComponent* SpringArm;
 UPROPERTY(VisibleAnywhere, Category = "Base Character")
 class UCameraComponent * CameraComp;
 UPROPERTY(VisibleAnywhere, Category = "Base Character")
 class UArrowComponent* TraceDirection;

You may need to include the headers for those classes in the CPP.

more ▼

answered Jul 06 '17 at 05:56 PM

avatar image

HailstoneRyan
709 39 26 53

avatar image Levenlol Jul 06 '17 at 06:13 PM

yep that's working. but in cpp how do i add the UCameraComponent header or the springarm ? i cannot find em :(

avatar image HailstoneRyan Jul 06 '17 at 06:15 PM
 #include "Camera/CameraComponent.h"
 #include "GameFramework/SpringArmComponent.h"

You can usually find the location of the headers on the class' API doc page.

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Camera/UCameraComponent/index.html https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/USpringArmComponent/index.html

(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