Please help, I'm stuck in CryptRaider course (re: "UFUNCTION(BlueprintCallable))

Could one of you geniuses help me out? I can’t figure out why none of my UFUNCTION(BlueprintCallable) custom functions will appear in Blueprints. I’ve tried compiling, recompiling, rebuilding the project. No errors, but also no show in the Blueprints for the BP_Player object.

[From Grabber.h]
public:	
	// Called every frame
	virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

	UFUNCTION(BlueprintCallable)
	void Grab();

	UFUNCTION(BlueprintCallable)
	void Release();

and

[From Grabber.cpp]
void UGrabber::Grab()
{
	FVector Start = GetComponentLocation();
	FVector End = Start + GetForwardVector() * MaxGrabDistance;
	DrawDebugLine(GetWorld(), Start, End, FColor::Red);

	FCollisionShape Sphere = FCollisionShape::MakeSphere(GrabRadius);
	FHitResult HitResult;

	bool HasHit = GetWorld()->SweepSingleByChannel(
		HitResult, 
		Start, End, 
		FQuat::Identity, 
		ECC_GameTraceChannel2,
		Sphere);
	if(HasHit)
	{
		AActor* HitActor = HitResult.GetActor();
		AActor *HitActor = HitResult.GetActor();
		UE_LOG(LogTemp, Display, TEXT("ObjectHit: %s"), *HitActor->GetActorNameOrLabel());
	}
	else
	{
		UE_LOG(LogTemp, Display, TEXT("No Actor Hit"));
	}
}

void UGrabber::Release()
{
	UE_LOG(LogTemp, Display, TEXT("Released Grabber"));
}

And would you mind showing trying to find that on the blueprint side?

I put all the steps I followed here in this google doc. (Don’t worry, it’s safe!)

Thanks for your help!

-Dave

That screenshot at the end shows that in your blueprint Grabber is a variable of type Object. You should remove that variable and then add a Grabber component.
image

YES! As I’m sure you read pretty often, damn it I feel stupid. Thanks SO much! It’s working!!!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms