I have a thread open on the AnswerHub here also: https://answers.unrealengine.com/questions/217700/aligning-actor-to-impactnormal.html - I haven’t been getting any responses so far so I thought I’d see if the great people of the forums could help me out.
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. So here are some screenshots of my alignment issue:
At certain angles the actor doesn’t align as it should:
This is good:
And this is bad:
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);
I have tried getting the rotation of the HitResult and manipulating that too but no joy, maybe there’s more I need to add?
Any help would be great. What am I doing wrong? Am I missing something?