Matching surface rotation without effecting local yaw

im trying to get an actor to land on the surface and adjust its rotation to match the plane of the "wall"without rotating its yaw.
i have tried mathing at the rotation but cant seam to figure it out.

i had this working under physics before but was causing serious issues with replication(mainly on low end cpu as listening host) so i know physics isnt the way.

my current solution is to do 2 line traces for x and 2 for y .then using the time output to figure the ratio of +/- then mulltiplying that by the equivelant rotation and setting. but this seams janky to say the least

this actor is going to be in 0 G with controll over roll so will need to work in any orientaion but the actors colliding surface will always be actor local down ie it always moves by having an actor relative downward movement but can change roll to "fall"sidways/up

any help would be awesome

You can get the rotation of a face on an object by using the normal of the face.


yeah thats simple what i am trying to achive is alot more complex

this guy can rotate around his roll



but if he hits at an angle thats not quite correct (nearly every time in real game conditions)

how can i take the normal and adjust his local pitch and roll but not yaw

i think theres a simple math way but i cant find it
any help would be awesome

I’m probably not getting this ( very probably ), but I made a BP which likes to keep it’s own random yaw, and I can still take the orientation from the normal:

So what was a turn in Z gets translated to a turn in Y for some reason…

1 Like

link text

this is a realy basic example

q rotates the roll 90
w,s for movement
aim is basic

you may understand better this way

in pie if you rotate the yaw by a few degrees then hit Q you will fall twards what was your left when you collide with the wall i want the cube to inheret the surface normal but not adjust the point of aims yaw (pitch is fine)

Sorry, no idea. It’s very hard to tell what exactly the pawn is doing.

I tried aligning it with the normal during fall, but it’s impossible to tell what’s going on.

Thanks for the example though…

1 Like

It’s certainly possible, I’m just not seeing it at the moment…

1 Like

the normal changes because its world alighned i was hoping to be able to pull the relative z of the surface normal then apply that to just the pitch and roll but that dosent seam to be an option.
so ill right a corrrection algorythem once i figure out what that algorthem should actuly do

1 Like