Apply Force In Direction Of Line Trace?

Hello, so I have a line trace that aligns my character to the surface and once it reaches a certain point I disable gravity and enable flying so I can go past 90 degrees.

Once I’m in this flying no gravity state though Its very easy for my character to float away from the surface.

My question is how can I apply a directional force (possibly from the line trace?) downward from my character to make them stick to the surface its aligned on?

This is really simple to do because the line trace gives you all the information you need. The hit result will contain something called the impact normal. This is the direction the hit surface is facing.

All you need to do is take the impact normal vector and multiply it by a negative number (opposite of the surface direction) that you feed into an add impulse node. You can do this off of tick or a timer if you need it to be consistently added.

Make sure to check velocity change on the add impulse node to factor in the mass of the target.

Thanks I was able to add force to the character movement with this although it doesn’t exactly make the character stick to the surface as I had hoped, I think this is due to the flying movement mode.

I’ll mark this as answered though thanks for the help!