Dear UE4 Community,
I'm trying to convert a header and cpp file syntax from an older version to 4.9, Can you please help me? Thanks. Iknow that USphereComponent is now declared as a pointer, but can't figure out the rest, thanks again.
class GOLDENEGG_API ANPC : public ACharacter
// This is the NPC's message that he has to tell us.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
// The sphere that the player can collide with to get item
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category =
TSubobjectPtr<class USphereComponent> ProxSphere;
// The corresponding body of this function is
// ANPC::Prox_Implementation, __not__ ANPC::Prox()!
// This is a bit weird and not what you'd expect,
// but it happens because this is a BlueprintNativeEvent
UFUNCTION(BlueprintNativeEvent, Category = "Collision")
void Prox( AActor* OtherActor, UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex, bool bFromSweep, const FHitResult &
ANPC::ANPC(const class FPostConstructInitializeProperties& PCIP) :
ProxSphere = PCIP.CreateDefaultSubobject<USphereComponent>(this,
ProxSphere->AttachTo( RootComponent );
ProxSphere->SetSphereRadius( 32.f );
// Code to make ANPC::Prox() run when this proximity sphere
// overlaps another actor.
NpcMessage = "Hi, I'm Owen";//default message, can be edited
// in blueprints
Oct 06 '15 at 08:30 PM
in C++ Programming