Adding blueprint node parameter that accepts 2 different classes?

I have a projectile manager and I want to allow attaching scene components (niagara systems) and actors, but the only way I could do that was to set its type to UObject. This causes the “Select Asset” dropdown to appear and you attach anything. Is there any way to restrict the blueprint node parameter to just USceneComponent and AActor? Below is my current node definition (all my code works and I just want this to be restricted for usability purposes).

	/**
	* Spawns a projectile entirely dependant on SweepMultiByChannel traces
	* @param Direction Supply the normalized directional vector. This expects values between -1.0 and 1.0. A direction is required and will default to 1,0,0 if not supplied.
	* @param Gravity Apply normalized directional vector gravity every frame. Note gravity will stop once it reaches an axis of -1.0 or 1.0. This expects values between -1.0 and 1.0.
	* @param GravityStart The time to start applying gravity.
	* @param Rotation Apply direction rotation every frame.
	* @param RotationStart The time to start applying rotation.
	* @param Lifetime The maximum time this projectile can exist. Will call OnExpire delegate.
	* @param Fork If this projectile should fork into additional projectiles on overlap. Will call OnFork delegate.
	* @param Chains The number of times this projectile can chain to nearby overlaps. Will call OnChain delegate.
	* @param ChainsRadius The maximum radius to look for a target to chain to. This uses the same TraceChannel as the projectile.
	* @param Bounces The number of times this projectile can bounce on blocking hits or overlap hits if not piercing. Will call OnBounce delegate.
	* @param Pierce If this projectile should pierce allowing multiple overlaps at once. Will call OnPierce delegate.
	* @param Returns The time before the projectile should return to its initial location. Blocking hits will cause an early return. Overlap hits will cause an early return if not Pierce. Will call OnReturn delegate.
	* @param Homing If this projectile should chase after the nearest overlap in HomingRadius.
	* @param HomingRadius The maximum radius to look for a target to home in on. This uses the same TraceChannel as the projectile.
	* @param HomingInterval The time between searching for a new homing target. This will be applied on first homing target attempt as well.
	* @param Pulse The frequency this projectile should pulse additional behavior. This can be useful if the projectile needs to apply a special effect or additional damage around itself at a set interval. Will call OnPulse delegate.
	* @param AttachComponent The component or actor to attach to this projectile for visual representation. Examples would be attaching a spawned in actor or particle system.
	* @param Constraints Constrain movement on the supplied axis. This expects a value of 1.0 to constrain the axis. Gravity and Rotation will still be applied, but the constained axis will not change. So this can result in oddities if for example Z axis is constrained while applying Z gravity.
	*/
	UFUNCTION( BlueprintCallable, meta = ( BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject", AutoCreateRefTerm = "IgnoreActors", Speed = "1000.f", HomingRadius = "600.f", ChainsRadius = "600.f", GravityStart = "0.5f", RotationStart = "0.5f", HomingInterval = "0.5f", Lifetime = "5.f", AdvancedDisplay="DrawDebugType,TraceColor,TraceHitColor,DrawTime" ), Category = "TraceProjectiles" )
		static UTraceProjectile* SpawnProjectile(
			UObject* WorldContextObject,
			const FVector Location,
			const FVector Direction,
			float Radius,
			float Speed, 
			const FVector Gravity,
			float GravityStart,
			const FRotator Rotation,
			float RotationStart,
			float Lifetime,
			bool Fork,
			int Chains,
			float ChainsRadius,
			int Bounces,
			bool Pierce,
			float Returns,
			bool Homing,
			float HomingRadius,
			float HomingInterval,
			float Pulse,
			ETraceTypeQuery TraceChannel,
			bool TraceComplex, 
			const TArray<AActor*>& IgnoreActors,
			UObject* AttachObject,
			const FVector Constraints,
			EDrawDebugTrace::Type DrawDebugType,
			FLinearColor TraceColor = FLinearColor::Red,
			FLinearColor TraceHitColor = FLinearColor::Green,
			float DrawTime = 1.f );

The parameter I’m referring to is AttachObject. Below is the undesired in-editor result.

image

It looks like AllowedClasses property metdata maybe could be used? I can’t find any examples though so I’ve no clue how to use it here. I’m guessing I can’t within the function parameters.

Still not having any luck. Tried adding UPROPERTY meta with AllowedClasses and does nothing for the BP function node.

Well it doesn’t throw any errors due to the checks I have in place when selecting from the content browser. So guess I’ll just leave it alone as I can’t seam to find a way to restrict it.