I have 2 cubes, one big, one small, the larger cube will be stationary, while the smaller cube will be given a force towards the larger cube with :
smallerCube.GetComponent<Rigidbody>().AddForce((largeCube.transform.position - smallerCube.transform.position).normalized * force);
now I want to find out how to add a force with a 90 degree offset on the Y axis from the above given direction
largeCube.transform.position - smallerCube.transform.position
so it will seem to orbit the largerCube with a force towards it as well as a sideways force with a 90 degree offset from the 'towards' direction.
how would I go about doing something like that, using Rigidbody physics.
You rotate a vector by simply multiply it with the according rotation using the * operator.
For an offset of 90° in the global Y axis you can use Quaternion.Euler like e.g.
var rotatedDirection = Quaternion.Euler(0, 90, 0) * (largeCube.transform.position - smallerCube.transform.position).normalized;