Hi all,
I’m new to UE4 and a bit rusty on C++ programming at the moment, I’m trying to follow up on the tutorial and on the new changes regarding the v4.6, I read that TSubobjectPtr<> was deprecated and now we should use pointers instead, so I was trying to understand how to achieve this and I’ll need a bit of help, this is how I’m trying to create my components:
Pickup.h
private:
/** Simple collision primitive to use as the root component. */
UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = Pickup)
USphereComponent BaseCollisionComponent;
First off what do they mean when they say that “We also added public accessor functions for subobjects (components) and deprecated all public subobject properties (we are not going to remove them, but make them private in 4.7).” Quote from Robert M. (second answer in thread). What I get from this is that the UPROPERTY will have to be constructed with a different way to access the parameters in v4.7.
But how do I manage to initialize my var on the .cpp file?, I’m trying
BaseCollisionComponent = FObjectInitializer.CreateDefaultSubobject<[type]>()
but this doesn’t work.