Rigidbody.AddForce equivalent of transform.Translate?

I making a game where players can alter their direction of gravity, allowing them to walk on walls and such. Currently the players’ movement is altered using translate because that can apply movement based of the transform’s local position. The problem here is that translate can force players through level geometry and I was hoping to utilise the rigidbody for movement to fix the problem, but this seems to apply to the character in worldspace, despite using TransformDirection, which means when the players walk on the roof, their input is reversed. Does anyone know of a good way to solve this problem?

EDIT:

This here is the relevant snippets of code, I haven’t provide the whole script because it’s about 200 lines and handles many things related to the player, but not specifically to the movement

void Update() {
	moveVector = new Vector3(playerInst.currState.ThumbSticks.Left.X, 0, playerInst.currState.ThumbSticks.Left.Y);
	moveVector *= moveSpeed;
	moveVector *= Time.deltaTime;


	rotateVector = new Vector3(0,playerInst.currState.ThumbSticks.Right.X, 0);
	rotateVector *= rotateSpeed;
	rotateVector *= Time.deltaTime;
}

void FixedUpdate() {
	rigidbody.AddForce(-gravity * rigidbody.mass * myNormal);
	
	myNormal = Vector3.Lerp(myNormal, surfaceNormal, lerpSpeed * Time.deltaTime);

	var myForward = Vector3.Cross(transform.right, myNormal);
	var targetRotation = Quaternion.LookRotation(myForward, myNormal);

	transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, lerpSpeed);
	transform.Rotate(rotateVector);	
		
	transform.Translate(moveVector);	
}

Without your code, it is difficult to be specific. But let’s say that ‘someMovement’ is a Vector3 that you are feeding to your transform.Translate. Your Rigidbody equivalent could be:

 Vector3 dir = transform.TransformDirection(someMovement);
 Vector3 pos = transform.position + dir;
 rigidbody.MovePosition(pos);

I know this is a 2 year old question but if anyone needs a way to Addforce to a rigidbody according to local position (So you can look around and move in the correct position) here it is in C#!:

This is assuming your variable movement is a Vector2, -1x = left , 1y = forward etc.

Play around with the speed until you move as much as you need. I used 20000 for my character.

Vector3 dir = transform.TransformDirection(movement);
myRigidbody.AddForce(dir * speed);

An easy way to change gravity direction is not to actually change the gravity direction but instead put your whole scene inside a DummyObject and rotate this.