Introduction to UE4 Programming - 3 - Creating the Base Pickup Class - Epic Wiki

# Introduction to UE4 Programming - 3 - Creating the Base Pickup Class

Author:

Epic Games

Description:

In this video, we’ll add our first class! This class will be the template for a generic pickup, and we will build on it more in later videos. We’ll also add our first function and variable, and talk about the UCLASS, UFUNCTION, and UPROPERTY macros.

Related Links:

Source

Source (4.4)

Source_4.72

UE 4.6 Changes:

  • "GENERATED_UCLASS_BODY()" macro is now "GENERATED_BODY()". You must also specify the public access manually under "GENERATED_BODY()" by adding "public:" directly under "GENERATED_BODY()".
  • You now need to manually add the constructor "APickup(const FObjectInitializer& ObjectInitializer);" under "public:" in the header file.
  • The constructor in the .cpp file is now: "APickup(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)", this means you also need to replace all references to "PCIP" with "ObjectInitializer"
  • The SubObject template pointer has been replaced. Use normal pointers now, e.g:
    "class USphereComponent* BaseCollisionComponent;"

Playlist Home

< Project Creation

Creating a Battery in C++ >

Retrieved from "https://wiki.unrealengine.com/index.php?title=Introduction_to_UE4_Programming_-_3_-_Creating_the_Base_Pickup_Class&oldid=12901"

Category: