Hi there,
I have my custom UActorComponent, I want to add it to my character , Component will appear on editor under my character , but when I call m_grabComponent->DoStuff() it is NULL .
What I’m missing ? thanks.
// Sets default values for this component's properties
USGrabObjectComponent::USGrabObjectComponent()
: m_bBlockFrontMovementNextTick(false)
, m_bBlockRightMovementNextTick(false)
, m_fGrabbingDistanceTreshold(10.f)
, m_fYawClampValueGamepad(0.1f)
, m_fYawClampValueMouse(1.f)
, m_fLastSignGrabbingRightward(0.f)
, m_fLastSignGrabbingForward(0.f)
, m_bCanYaw(true)
, m_bCanYawLeft(true)
, m_bCanYawRight(true)
, m_bCanMoveLeft(true)
, m_bCanMoveRight(true)
, m_bCanMoveForward(true)
, m_bCanMoveBackward(true)
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
bWantsBeginPlay = true;
PrimaryComponentTick.bCanEverTick = true;
// ...
}
ASurvivalCharacter::ASurvivalCharacter(const class FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer.SetDefaultSubobjectClass<USCharacterMovementComponent>(ACharacter::CharacterMovementComponentName))
, TIME_TO_CONSIDER_INPUT_AS_PRESSED(0.5f)
, m_fInteractTimeCounter(0.f)
, m_fDropThrowTimeCounter(0.f)
, m_bIsInteractTimerActive(false)
, m_bIsDropThrowTimerActive(false)
, m_actualEquippedObject(nullptr)
, m_fInitialBaseTurnRate(45.f)
, m_fSpeedMultiplier(1.f)
, m_bHangingDecaysStamina(true)
, m_bWallRunningDecaysStamina(true)
, m_bClimbingLedgeDecaysStamina(true)
, m_fStaminaFixedTimeForRecoveryWait(0.1f)
, m_fStaminaMaxWaitingTime(5.0f)
, m_fTimeToWaitForStaminaRecovery(0.f)
, m_fStaminaDelayCounter(0.f)
, m_bWaitToRecoveryStamina(false)
, m_eStaminaRecoveryState(ESRS_END)
{
...
...
...
m_grabComponent = CreateDefaultSubobject<USGrabObjectComponent>(TEXT("GrabComponent"));
...
...
...
}