# Aligning actor to ImpactNormal

**URL:** <https://forums.unrealengine.com/t/aligning-actor-to-impactnormal/316327>\
**Category:** C++\
**Tags:** align, unreal-engine, CPP, question\
**Created:** [April 24, 2015, 11:17pm UTC](https://forums.unrealengine.com/t/aligning-actor-to-impactnormal/316327 "2015-04-24T23:17:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZeJudge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZeJudge](https://forums.unrealengine.com/u/ZeJudge)\
**Post date:** [April 24, 2015, 11:17pm UTC](https://forums.unrealengine.com/t/aligning-actor-to-impactnormal/316327/1 "2015-04-24T23:17:23Z")

</div>

Hi all,

I’m having an issue aligning my actor correctly to another actor. I’ve had this issue for a while now but have been putting it off haha. So here are some screenshots of my alignment issue:

At certain angles the actor doesn’t align as it should:

This is good:

 ![40176-good.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/e/66ec00b1539d4762c6428b8b3b70e656dd46b378.png)

And this is bad:

 ![40178-bad.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/6/be6b1c29bb6071da8e23a8c1c93ed37f12c19736.png)

My code:

```
SpawnedBlueCubeGhost->SetActorTransform(HitResult.GetActor()->GetTransform());
										
FVector TempLocation = HitResultLocation;
TempLocation += HitResult.ImpactNormal.Rotation().Vector() * 100.0;
SpawnedBlueCubeGhost->SetActorLocation(TempLocation);

FRotator TempRotation = HitResult.ImpactNormal.Rotation();
TempRotation.Pitch = TempRotation.Pitch + 90.f;
SpawnedBlueCubeGhost->SetActorRotation(TempRotation);

```

Any help would be great. What am I doing wrong? Am I missing something?

Thanks,  
Jon
