meta=(ExposeFunctionCategories= is not working with ALT+Dragged copies of a Custom CPP Actor Class using a custom BP-friendly Component.

Dear Friends at Epic,

Hiiiiii!

I have a custom component on a custom actor that extends TargetPoint

The component is BP friendly, and if I add the component to a BP class like AStaticMeshActor and alt drag the BP class, then it works fine, the component is duplicated onto the new ALT dragged copy

So that works!

#Custom Actor Class

My custom CPP actor class derives from TargetPoint

I make a BP of this CPP actor class, which is just a wrapper for my custom component.

The original, dragged from the Browser into the world, DOES work! It has the component when I press F4 to look at, and I can even edit the values of the component directly from the F4 menu of the Actor.

But

When I click on the instance of the BP of my custom actor class

and ALT-Drag to make a copy

The copy of the original does NOT have the component on it!

It is listed as none.

So there is some difference in the code between ALT Dragging, and the initial drag of my BP Custom Actor class into the world

#Question

Any ideas how I can make my custom CPP actor with its custom Component copy correctly using ALT+ Drag ?

The core of all this is related to

meta=(ExposeFunctionCategories="SolusLookAtComponent")

This feature, to see the component properties from the F4 menu of the actor instance, is not working for ALT-Dragged copies of the custom Actor CPP class.

Hourences and the rest of the Solus team really need this to work !

#Pictures Of The Issue

#Custom Actor Class

/*

	By Rama

*/

#pragma once

#include "SolusLookAtComp.h"

#include "SolusLookAtActor.generated.h"

UCLASS()
class ASolusLookAtActor : public ATargetPoint
{
	GENERATED_UCLASS_BODY()

	UPROPERTY(Category=SolusLookAtActor, VisibleAnywhere, BlueprintReadOnly, meta=(ExposeFunctionCategories="SolusLookAtComponent"))
	TSubobjectPtr<USolusLookAtComp> SolusLookAtComp;
};

#Custom Component Class

/*

By Rama

*/

#pragma once

#include "SolusLookAtComp.generated.h"

UCLASS(ClassGroup=Solus, meta=(BlueprintSpawnableComponent))
class USolusLookAtComp : public UPrimitiveComponent
{
	GENERATED_UCLASS_BODY()
	
	/** This is the core data for this individual Look At Component! This String must be unique within the current level. This exact String is sent to the Level Blueprint via the event SolusLookAtEventOccurred. Copy and paste this value you put here into the SwitchOnString in the Level Blueprint to detect when this particular Look At Comp fires off its event. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite,Category=SolusLookAtComponent)
	FString LookAtName__UniqueToCurrentLevel;
	
	/** Tick Frequency, how often the trace will be done */
	UPROPERTY(EditAnywhere, BlueprintReadWrite,Category=SolusLookAtComponent)
	uint8 TraceTickFrequency;
	
	/** If player is beyond this range, no Look At event will be registered / it is the length of the trace*/
	UPROPERTY(EditAnywhere, BlueprintReadWrite,Category=SolusLookAtComponent)
	float TraceMaxRange;
	
	/** How Exactly Perfectly must player be looking in direction of the Look At Component to Trigger the Event? This is the allowed degrees of variance from perfectly facing the component. */
	UPROPERTY(EditAnywhere, BlueprintReadWrite,Category=SolusLookAtComponent)
	float AllowedAngleVarianceToStillTriggerEvent;
	
	/** Disabled after Runs once, this value is saved as part of the Solus Save Game System */
	UPROPERTY(EditAnywhere, BlueprintReadWrite,Category=SolusLookAtComponent)
	bool RunsOnce;
	
public:
	
	void DoLookAtTrace();
	
//~~~~~~~~~~~~~~~~~~~
//	   Has Run At Least Once
//~~~~~~~~~~~~~~~~~~~
//THIS IS THE VALUE TO SAVE TO DISK AND LOAD, WHETHER IT IS FALSE OR TRUE
public:
	bool HasRunAtLeastOnce;

//~~~~~~~~~~~~~~
//	   Staggered Timer
//~~~~~~~~~~~~~~
protected:
	uint8 SolusTickTimer;
	
protected:
	
	//Init
	virtual void InitializeComponent() OVERRIDE;
	
	//Tick
	virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) OVERRIDE;
};

Hi Rama, this indeed looks like a bug. I’ll look into it and get back to you as soon as I find the cause.

Thank you so much Robert!

#:heart:

Rama

Hey Rama,

Unfortunately I was unable to reproduce this bug with latest code but here’s my repro steps in case I missed something:

  1. I set up a project and copied code you provided to add ASolusLookAtActor and USolusLookAtComp.
  2. In the constructor of ASolusLookAtActor, I created a new USolusLookAtComp, like so: SolusLookAtComp = PCIP.CreateDefaultSubobject(this, “LookAtSolus”);
  3. I then compiled code, opened the editor and created a new blueprint based on ASolusLookAtActor, compiled and saved it.
  4. I spawned a new instance of the BP class by dragging it from the content browser to the viewport.
  5. I then ALT+Dragged the actor instance but I was able to see the component in the details panel.

Dear Robert,

Hi there!

Hmm I tried removing everything from the Look At Actor constructor except the line you mentioned, of actually making the component.

I still get the same behavior, so I shall assume this is an issue that is fixed in the master branch!

Thanks for looking into this Robert!

Rama

#Full CPP

If you have the time and you still have that test setup you created, here is the full .cpp for the Look At Component, minus code that would not compile for you :slight_smile:

I tried commenting out auto activate and then eventually commented out the entire constructor, but the behavior I am reporting remains the same.

The source is really tiny but apparently just too big for being a comment on answerhub

link text

Again I shall assume this is fixed as of Master Branch and will try again in 4.3 :slight_smile:

Thanks Robert!

I hope this issue is not dead, because I indeed am having the same problem