For everyone who is looking for this feature as blueprint node:
- Create a New C++ Class -> Blueprint Function Library named ServoSupport
- Copy & Paste the code:
Header file:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "PhysicsEngine/PhysicsConstraintComponent.h"
#include "ServoSupport.generated.h"
/**
*
*/
UCLASS()
class ROBOTICS_API UServoSupport : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintPure, Category = "Servo")
static void GetConstrainedActors( UPhysicsConstraintComponent* ServoComponent, AActor*& ConstraintActor1, AActor*& ConstraintActor2 );
};
CPP:
// Fill out your copyright notice in the Description page of Project Settings.
#include "ServoSupport.h"
void UServoSupport::GetConstrainedActors(UPhysicsConstraintComponent* ServoComponent, AActor*& ConstraintActor1, AActor*& ConstraintActor2)
{
ConstraintActor1 = ServoComponent->ConstraintActor1;
ConstraintActor2 = ServoComponent->ConstraintActor2;
}
Feel free to refactor the names…
Hope this helps!
Maybe I’ll find the time to pull request this…