# How can I best use Rotation of FHitResult?

**URL:** <https://forums.unrealengine.com/t/how-can-i-best-use-rotation-of-fhitresult/284291>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 26, 2014, 4:40pm UTC](https://forums.unrealengine.com/t/how-can-i-best-use-rotation-of-fhitresult/284291 "2014-05-26T16:40:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_44db827a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_44db827a](https://forums.unrealengine.com/u/anonymous_user_44db827a)\
**Post date:** [May 26, 2014, 4:40pm UTC](https://forums.unrealengine.com/t/how-can-i-best-use-rotation-of-fhitresult/284291/1 "2014-05-26T16:40:57Z")

</div>

Hey! I am trying to create a script to allow me to check if the surface that the player has collided with is a wall, so that they can wall jump. Here is what I thought about doing:

```
//Get Collision Info
void AFPSCharacter::OnHit(AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
	if (Hit.Rotation > wJumpSteepness && CharacterMovement->IsMovingOnGround())
	{
		canWallJump = true;
	}
}

```

With Hit.Rotation replacing the steepness of the surface. Is this possible? If someone could help me with this, it would be much appreciated! Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 27, 2014, 1:55am UTC](https://forums.unrealengine.com/t/how-can-i-best-use-rotation-of-fhitresult/284291/2 "2014-05-27T01:55:17Z")

</div>

#ImpactNormal

What you want is

```
Hit.ImpactNormal

```

This is the Vector representing the facing direction of the surface at the point of impact, in world space

to get this as a rotation:

```
const FRotator SurfaceRotation = Hit.ImpactNormal.Rotation();

```

Just know this is in world space and you can decide what qualifies as a sufficient angle for wall jumping

for example

if you wanted all walls to be at elast 70 degrees from the flat ground plan (almost totally vertical)

you would do

```
const FRotator SurfaceRotation = Hit.ImpactNormal.Rotation();
if(FMath::Abs(SurfaceRotation.Pitch) > 70)
{
  //yes this is a wall jump
}

```

to make sure you are getting the numbers you expect

make sure to LOG or output this value so you can see it exactly

```
const FRotator SurfaceRotation = Hit.ImpactNormal.Rotation();

```

#Log / To Screen Wiki

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_44db827a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_44db827a](https://forums.unrealengine.com/u/anonymous_user_44db827a)\
**Post date:** [May 27, 2014, 5:10am UTC](https://forums.unrealengine.com/t/how-can-i-best-use-rotation-of-fhitresult/284291/3 "2014-05-27T05:10:52Z")

</div>

Thank you very much (this is somewhat how it works in Unity as well)!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 27, 2014, 10:24am UTC](https://forums.unrealengine.com/t/how-can-i-best-use-rotation-of-fhitresult/284291/4 "2014-05-27T10:24:12Z")

</div>

You’re welcome!

🙂

Rama
