How do I change gravity to go either Up, Down, Left or Right?

Here’s a previous post that might help. This was from 2020 and they say setting gravity to negative with the platformer behavior isn’t a very good idea. Unless they updated it recently for such.
My takeaway from that is to work with force angle.
Like, if the player gravity variable is 3oclock : add force angle 270 degrees 800px. Something like that. So you can even get diagonal directions as well.
You might want to look into physics engine as well as suggested in this same post.