I’ve written a class inheriting from the ACharacter class and I’m at the moment
trying to make it so that my actor aligns its pitch to the ground.
My method is to cast a ray from my actor location down along the actors up vector
and then using the impact normal to calculate the vector representing the current angle.
The method returns a float value that I then want to use as a part of the param in the AddControllerPitchInput method.
As mentioned in the heading this has no effect. I searched the web for an explanation and found out (without a reason why)
that ticking the attribute bUsePawnRotation in both my springArm and camera would solve the issue.
I set both of the attributes to true in the class constructor but it had no effect. After that I started to doubt
my linear algebra. To see if my calculations was the problem I used my values in the method SetActorRotation
instead. This pitched my character to the angle I was seeking but with the stuttering issues that comes with
the mentioned method.
Any ideas of where to go from here?