Obstacle Assault with FellOutOfWorld-override and rotation around an angle

Based on the response of @SteveMerritt to @oSpace I implemented the FellOutOfWorld override. However, I had to recreate the BP_ThirdPersonCharacter from the lecture. Would there have been an easier way, i.e. reusing BP_ThirdPersonCharacter in any way?

Additionally, I implemented a “circling” platform by rotating it around an axis and added a simple timer.

Here are some screenshots and code snippets:



void AMovingPlatform::CirclePlatform(float DeltaTime)
{
	CircleAngle += CircleVelocity * DeltaTime;
	FVector CurrentMove = CircleRadius.RotateAngleAxis(CircleAngle, CircleAxis);
	SetActorLocation(StartLocation + CurrentMove);
	// Only one rotation "source" possible
	if(EnableCirclingRotation && (!EnableRotating))
	{
		// Rotate actor so that it faces the center of the circle it moves along
		SetActorRotation(FQuat(StartRotation + (CircleRotationAxis * CircleAngle)));
	}
}

If I update and extend this level later on, I will update this thread.

Thanks for taking the time!

1 Like

I went back to my original post and realized that I forgot to mention a key step - you can simply re-parent BP_ThirdPersonCharacter to the thin C++ class I described that overrides the FellOutOfWorld function. Everything in BP_ThirdPersonCharacter will continue to function as before because our custom parent derives from the original Character base class. This is one of the fundamental features of inheritance in C++.

I never heard from @oSpace again, so I 'm glad someone was able to get some use out of my very long-winded post. :grin:

1 Like

Thanks - that makes a lot of sense! :smiley:
Immediately found the respective option within the class settings:

Surely, I won’t be the last one to be thankful for your suggestion. :upside_down_face:

1 Like

Privacy & Terms