About 'Querying Overlapping Actors'!

  • Creating hand hold actors.
  • Handling overlap events.
  • Querying overlapping actors.
  • Printing on the rising edge.

(Unique Video Reference: 22_AE_VR2)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

So I had an issue that was driving me crazy. Not sure if it’s a one off thing on my end, but figured I would share in case anyone runs into a similar issue.

Near the end of this lecture my program crashed and had some issues recovering the program. When I tried to run it again I was given an error “c0000005 (first/second chance not available)”. After some digging I found that RightController was a nullptr and the program crashed every time FindTeleportDestination was run.

What ended up being the issue was, on the BP_VRCharacter (in the details pane) I was overlooking the “Hand Controller Class” which was showing “None”. Once I switched that over to “BP_HandController” everything went back to working.

I left my computer on the challenge screen a couple of days, forgot about the parameters of the challenge and came back to it. Then implemented it slightly differently - with an overlap reference counter.

void AHandController::ActorBeginOverlap(AActor* OverlappedActor, AActor* OtherActor)
{
	if (OtherActor->ActorHasTag(TEXT("Climbable")))
	{
		CurrentOverlapCount++;
		bCanClimb = true;

        if (CurrentOverlapCount == 1) UE_LOG(LogTemp, Warning, TEXT("We can climb!"));
	}
}

void AHandController::ActorEndOverlap(AActor* OverlappedActor, AActor* OtherActor)
{
	if (OtherActor->ActorHasTag(TEXT("Climbable")))
	{
		CurrentOverlapCount--;

		// stopped overlapping with last climbable object
		if (CurrentOverlapCount == 0)
		{
			bCanClimb = false;
			UE_LOG(LogTemp, Warning, TEXT("We cannot climb :("));
		}
	}
}

Arguably then we don’t even need the boolean.

Privacy & Terms