OnJumped_Implementation Not Virtual (4.7 P4)

The Unreal Engine 4 docs for ACharacter::OnJumped_Implementation shows that it is virtual. However, the actual file in the source, for 4.7 P4 at least, is not virtual. This prevents the event from being overridden.

It is very easy to download the source code from git-hub edit the code to make it virtual and build it to get your very own custom compiled engine with virtual .OnJumped_Implementation. its also easy to migrate your project your custom compiled version

There are a lot of things which needs to fixed but there are many which you can simply tailor to your needs by building form the source rather than waiting for epic to do it.

While this is true, I currently have no other need to build a custom version of the engine.

I would also like this bug to be fixed so that when others come along, they also don’t have to do this. An Unreal Engine Developer has actually mentioned overriding this event in the , so it may now be misleading those who read that.

The event is empty in Character.cpp, so the entire purpose of the event is to be overridden with custom functionality.

Hi ,

I’ve requested the documentation be corrected for UE 4.7 [UEDOC-1107]. When this issue is corrected, an update will be added to this post.

Thanks for helping us provide accurate information in our documentation!

So in 4.6 ACharacter::OnJumped() was marked as a BlueprintImplementableEvent which meant that you needed to implement ACharacter::OnJumped_Implementation() in order to be notified when your character jumps.

In 4.7 ACharacter::OnJumped() is now marked as a BlueprintNativeEvent which means that ACharacter::OnJumped_Implementation() is now meanlinless because it will never get called by anything anywhere.

As best I can tell, ACharacter::OnJumped_Implementation() was supposed to be marked with a deprectation warning and ACharacter::OnJumped() should be marked as virtual maybe?

What should be happening here?

Edit:

I see that in master his has been fixed, this should really make it into 4.7.1.

Thanks

We may not be able to update the function as “virtual” in a patch because it will change the vtable which is bad for the binaries.

Easiest fix if you have engine source is to add the “virtual” yourself in Character.h.

Another option if you don’t want to modify the engine source:

Override ACharacter::CheckJumpInput() in your own Character and replace it a copy of the engine source, but call your own “OnJumped” version. Example:

void MyCharacter::CheckJumpInput(float DeltaTime)
{
	const bool bWasJumping = bPressedJump && JumpKeyHoldTime > 0.0f;
	if (bPressedJump)
	{
		// Increment our timer first so calls to IsJumpProvidingForce() will return true
		JumpKeyHoldTime += DeltaTime;
		const bool bDidJump = CanJump() && GetCharacterMovement() && GetCharacterMovement()->DoJump(bClientUpdating);
		if (!bWasJumping && bDidJump)
		{
			// YOUR CODE HERE. Was: OnJumped();
		}
	}
}

(edits: Have to use GetCharacterMovement() outside ACharacter)

According to developers responding to report [UEDOC-1107], “code has been fixed to restore the virtual” in a near future release of the engine, therefore we will not be updating the documentation. Thanks again for the feedback and let us know if the fix does not resolve your issue.