"Add Force" adding force in wrong direction

I'm trying to get a grapple hook working. I've reviewed the code and have narrowed it down to these 3 situations where there should be a mistake. Else there must be some kind of demon cursing me.

Grapple blueprint: Every tick, if my hook hit something, a force is applied to me towards the hook. If I get close to the hook, it breaks. If I pass it, it breaks.

On grapple hit: When the grapple hits a surface, my ground friction and gravity scale get set to 0 to facilitate lift off and air control is increased. To take off I get an initial pull (velocity). Don't worry about initial hook direction 2d.

To grapple hook: When the hook is attached to a surface, I subtract its location to mine, thus getting the vector going from my position to the hook. I then normalize this vector to have it be easily scalable.
https://imgur.com/a/9w9grav

My problem is that as soon as my grapple hits I do get launched, but in the wrong direction. That is, the x and y components of the direction are correct, but the z isn't. I get launched upwards and a little towards the hook in a parabolic manner. I checked the To Grapple Hook direction by tracing it. It's correct. I'm completely lost.

Posted Aug 17, 2024, 10:56 AM UTC

24

Comments aren't archived yet

This post had 4 comments on Reddit. Comments for this period haven't been loaded into the archive yet.