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"

[Bug] UE4 C++ Tutorials [v4.3.1]

Branch: Binary

Build Version: 4.3.1

Description: While following along with the C++Tutorials on the UnrealEngine YouTube Channel, I get some strange errors, two of which are about my Pickup.cpp but the others are engine files that I have not edited at all. I have added my code below as well as the errors I am receiving.

Pickup.cpp

 #include "TutorialCode.h"
 #include "Pickup.h"
 
 
 APickup::APickup(const class FPostConstructInitializeProperties& PCIP)
     : Super(PCIP)
 {
     //The pickup is valid when created
     bISActive = true;
 
         // Create the sphere componenet to handle the pickups collision
         BaseCollisionComponent = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("BaseSphereComponent"));
 
     //Set the SphereComponent as the root component
     RootComponent = BaseCollisionComponent;
 
     //Create the static mesh component
     PickupMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("PickupMesh"));
 
     //Turn Physics On
 
     PickupMesh->SetSimulatePhysics(true);
 
     //Attach the static mesh to the root component
 
     PickupMesh->AttachTo(RootComponent);
 
 
 
 }
 
 
 void APickup::OnPickedUp_Implementation()
 {
     //There is no Default Behavior
 }
 

Pickup.h

 #pragma once
 
 #include "GameFramework/Actor.h"
 #include "Pickup.generated.h"
 
 /**
  * 
  */
 UCLASS()
 class TUTORIALCODE_API APickup : public AActor
 {
     GENERATED_UCLASS_BODY()
 
         /** True when the pickup is able to be picked up, flase if something deactivates it. */
         UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Pickup)
         bool bISActive;
 
     //Simple Collision Primitive to use as the root component
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
         TSubobjectPtr<USphereComponent> BaseCollisionComponent;
 
     //StaticMeshComponent to represent the pickup in the level
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
         TSubobjectPtr<UStaticMeshComponent> PickupMesh;
 
     //Sets behavior for when the player picks up object
     UFUNCTION(BlueprintNativeEvent)
     void onPickup();
 
 
     
     
 };
 

ERROR LIST:

Error 1 error C2039: 'OnPickedUp_Implementation' : is not a member of 'APickup' C:\Users\Mitchell\Documents\Unreal Projects\TutorialCode\Source\TutorialCode\Private\Pickup.cpp 35 1 TutorialCode

Error 2 error C2039: 'bIsActive' : is not a member of 'APickup' C:\Users\Mitchell\Documents\Unreal Projects\TutorialCode\Intermediate\Build\Win64\Inc\TutorialCode\TutorialCode.generated.cpp 83 1 TutorialCode

Error 3 error : Failed to produce item: C:\Users\Mitchell\Documents\Unreal Projects\TutorialCode\Binaries\Win64\UE4Editor-TutorialCode-Win64-DebugGame.pdb C:\Users\Mitchell\Documents\Unreal Projects\TutorialCode\Intermediate\ProjectFiles\ERROR TutorialCode

Error 4 error MSB3073: The command ""C:\Program Files\UnrealEngine\Unreal Engine\4.3\Engine\Build\BatchFiles\Build.bat" TutorialCodeEditor Win64 DebugGame "C:\Users\Mitchell\Documents\Unreal Projects\TutorialCode\TutorialCode.uproject" -rocket" exited with code -1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets 38 5 TutorialCode

Error 5 IntelliSense: identifier "FWindSourceSceneProxy" is undefined c:\Program Files\UnrealEngine\Unreal Engine\4.3\Engine\Source\Runtime\Engine\Classes\Components\WindDirectionalSourceComponent.h 20 2 TutorialCode

Error 6 IntelliSense: identifier "FOnSelectedLevelsChangedEvent" is undefined c:\Program Files\UnrealEngine\Unreal Engine\4.3\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1899 2 TutorialCode

Error 7 IntelliSense: identifier "FMeshBatchElement" is undefined c:\Program Files\UnrealEngine\Unreal Engine\4.3\Engine\Source\Runtime\ShaderCore\Public\VertexFactory.h 475 131 TutorialCode

Error 8 IntelliSense: class "APickup" has no member "OnPickedUp_Implementation" c:\Users\Mitchell\Documents\Unreal Projects\TutorialCode\Source\TutorialCode\Private\Pickup.cpp 35 15 TutorialCode

Thanks for your help :)

Mitchell

Related Forum Post: https://forums.unrealengine.com/showthread.php?28157-Help-with-UE4-C-Tutorials

Product Version: Not Selected
Tags:
more ▼

asked Aug 09 '14 at 04:38 PM in Bug Reports

avatar image

FV Panda
8 4 5 8

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

OnPickedUp_Implementation should be for a function called OnPickedUp, but it looks like your function is called onPickup, so try onPickup_Implementation instead.

I'd also recommend renaming bISActive to bIsActive to avoid any potential issues with UHT and FName case. https://answers.unrealengine.com/questions/72045/may-i-use-playerid-as-my-ustruct-member-variable-n.html

You can ignore the intellisense "errors" (they're not errors). Intellisense is really easy to confuse, so I wouldn't put too much faith in it. The only errors you need to care about are ones generated by the compiler.

more ▼

answered Aug 09 '14 at 04:50 PM

avatar image

Jamie Dale STAFF
7.3k 176 66 304

avatar image FV Panda Aug 09 '14 at 05:08 PM

Thanks for the help. With that I was able to figure out what happened.

onPickup like you said had a lowercase 'O' but the implemented line was "OnPickedup" changing that eliminated that particular error.

The bISActive error was indeed just me naming it wrong. it should have been bIsActive (my shift key must have stuck) in short it was user error lol

Again thank you very much, you were a big help :)

(comments are locked)
10|2000 characters needed characters left
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