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 problem

I added SpringArmComponent in my character. But I can't assign values to variables.

alt text

I have already used #include "GameFramework/SpringArmComponent.h" and #include "Camera/CameraComponent.h".

What am I doing wrong?

*.h file.

 #include "CoreMinimal.h"
 #include "Characters/Base_Character.h"
 #include "Player_Character.generated.h"
 
 /**
  * 
  */
 UCLASS()
 class FG_CPP_API APlayer_Character : public ABase_Character
 {
     GENERATED_BODY()
 
     UPROPERTY(BlueprintReadOnly, VisibleDefaultsOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
         class USpringArmComponent * SpringArm;
 }:

*.cpp file

 #include "Player_Character.h"
 #include "Components/SkeletalMeshComponent.h"
 #include "Components/CapsuleComponent.h"
 #include "Camera/CameraComponent.h"
 #include "GameFramework/SpringArmComponent.h"
 
 
 // Constructor
 APlayer_Character::APlayer_Character()
 {
     SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
     if (SpringArm)
     {
         SpringArm->SetupAttachment(GetCapsuleComponent());
         SpringArm->RelativeLocation = FVector(-20.f, 0.f, 40.f);
 
         SpringArm->TargetArmLength = 0.f;
         SpringArm->bDoCollisionTest = false;
         SpringArm->bUsePawnControlRotation = true;
         SpringArm->bInheritPitch = false;
         SpringArm->bInheritRoll = true;
         SpringArm->bInheritYaw = true;
     }
 }

Product Version: UE 4.20
Tags:
1.png (8.8 kB)
more ▼

asked Aug 01 '18 at 04:30 PM in C++ Programming

avatar image

X_Starter_X
25 1 4 7

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

1 answer: sort voted first

You are doing nothing wrong. The project will actually compile. Those errors are from intellisense because of a bug introduced with unreal 4.20. The bug is already fixed and the fix will be available with 4.20.2 hotfix.

https://issues.unrealengine.com/issue/UE-62042

In the meantime you can use the workaround I've posted here: https://answers.unrealengine.com/questions/810626/vs-cannot-find-generatedh-files.html

It will only fix your code related intellisense errors. It won't fix the engine ones but will let you work a little bit more comfortable.

more ▼

answered Aug 01 '18 at 06:06 PM

avatar image

Sveitar
1k 8 24 27

avatar image X_Starter_X Aug 01 '18 at 06:44 PM

Thanks for the reply. I will wait for the next hotfix.

(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