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"

TSubObjectPtr problems for a noob programmer.

Hello UE4 community! I've been diligently clawing my way up from the bottom of the C++ pits up the alabaster tower of programming, copying and trying to understand the theory and code bit by bit. Unfortunately I have ran into a snag. The tutorial I an doing is for an earlier version of UE and I do not possess the knowledge to deal with this on my own accord. This is what the tutorial dictates for me to do but unfortunately it seems that the TSubobjectPtr<> has been deprecated and is no longer usable. What do I need to do to fix this and most importantly how/why? Thank you all in advance!

 #pragma once
 #include "GameFramework/Character.h"
 #include "NPC.generated.h"
 class GOLDENEGG_API ANPC : public ACharacter
         UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Collision)
         TSubobjectPtr<class USphereComponent> ProxSphere;
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = NPCMessage)
         FString NpcMessage;
     // Sets default values for this character's properties
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
     // Called every frame
     virtual void Tick( float DeltaSeconds ) override;
     // Called to bind functionality to input
     virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
Product Version: UE 4.10
more ▼

asked Jun 01 '16 at 10:36 PM in C++ Programming

avatar image

1 1 1 2

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

1 answer: sort voted first

replace it with

 class USphereComponent* Sphere;

The other way was a workaround on older versions

more ▼

answered Jun 01 '16 at 11:18 PM

avatar image

7k 143 28 172

(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