Rotating the 'Add Force at Location' location vector using a hit normal's 'y' rotator value creates unexpected behaviour. I think I'm doing it wrong, could somebody help?

Hi all :slight_smile: I have a hovercraft that is pushed by 2 ‘Add Force at Location’ nodes for gameplay reasons. I want to rotate the location vectors of these Add Force at Location nodes so the force is parallel to the ground plane, rather than using the current rotation of the mesh they’re parented to, exactly how this video (timestamped) briefly talks about.

My current idea is doing a line trace to the ground, getting the impact normal, making a rotator from Y, splitting that struct into it’s axis to isolate the pitch, then plugging that in to the ‘RotateVectorAroundAxis’ node’s ‘Angle Deg’. I then use my hovercraft’s right vector as the axis to rotate around and use my current AddForceAtLocation location vector as the ‘In Vect’. I then output my results into the AddForceAtLocation node’s location.


(The line trace is not currently hooked up to an exec path but was during testing).

To my mathematically untrained eye I believe this should work and it does… if the ground the hovercraft is on is perfectly flat. As soon as the hovercraft hits an angled surface and the thrust is activated, it starts spinning wildly in circles around the right vector of the mesh. Can someone point out what I may be doing wrong? I’ve checked, and I’m getting the right number from the pitch (i.e. 20 is returned when on a slope angled at 20 degrees) so I’m unsure what isn’t working. This is pretty much my first foray into vectors properly so I don’t know them very well, which is definitely adding to my confusion!

Thank you so much for this graph! I have been struggling with understanding how to calculate “AngleDeg”!
This has been immensely helpful :smiley: