Hi there. So I have two custom USTRUCT’s, and a C++ function which I want to call in Blueprint:
USTRUCT(BlueprintType)
struct FProjectileParams
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
FVector StartLocation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
FRotator StartRotation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float Velocity;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float RotationSpeed;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
FRotator DesiredRotation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float WaitTime = 0.f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float LauncherRotationSpeedYaw;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float LauncherRotationSpeedPitch;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
UStaticMesh* Mesh;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float SizeK = 1.f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float FuelTank = 1.f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float FuelExpense = 0.f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
bool isBallistic;
};
USTRUCT(BlueprintType)
struct FTargetParams
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
FVector StartLocation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
FRotator StartRotation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float Velocity;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float RotationSpeed;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
TArray<FVector> Path = {};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
UStaticMesh* Mesh;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float SizeK = 1.f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float FuelTank = 1.f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
float FuelExpense = 0.f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Initialize")
bool isBallistic;
};
In this function I first take some values from those structures and then write down some other values into ProjectileParams, that’s why I use &
UFUNCTION(BlueprintPure, meta = (Step = 0.1))
bool ParabolaParabola3D(FProjectileParams& ProjectileParams, FTargetParams& TargetParams, float Step, float& CollisionTime);
But when I call this function in Blueprints, this is what it looks like:
So the question is how do I make it look not that ugly? How do I avoid those two “Set” nodes? Maybe some other function which will take the results and then just manually write down all the information? Please help.