Get desired rotation direction from two vectors & set to character

Hi,

I have a third person character setup similar to the blueprint template. The movement is Camera Based (meaning if I press forward, it walks in the direction the camera faces).

Currently I am building wall running logic and it works well for the most part, but the problem I’m having is that the player can turn the character into the wall or away from it.

I want the player to stick to the wall and not to rotate based on the camera anymore.

My idea is to do a line trace from the character to each side so it hits the wall he’s running on to grab the impact point, then the setup looks something like:

08845af091763b7f674d53ea74372ce901bd2c12.jpeg

But the rotation it’s giving me is wrong. For example when I get 60 it should be 180 and I get -90 when it should be 140.

That’s the first problem.

The second, is how do I apply the rotation to my character? I think I can uncheck ‘Orient Rotation to Movement’ while wall running to help. But what node do I use to apply it? I have tried applying with ‘Set Actor Rotation’ in the Character blueprint, as well as everything else I can think of. Nothing works, it usually just causes the character to glitch (movement gets stuck etc and it wigs out).

I would appreciate any insight. Thanks!

Well, I found the node I needed.

Impact Normal -> Make Rot from Z.

That gives me the rotation… I guess that’s solved then…