changing numbers in Constant Force

hi
I have a prefab that has a constant force. as you know in constantforce.force there are 3 vector " X , Y , Z" . I want that when prefab instantiated use “Moving.a” number (is a float) in X and use “Moving.b” number (is float to ) in Z. I used this command :

constantForce.force = Vector3.right * Moving.a;
constantForce.force = Vector3.forward * Moving.b;

but it doesn’t work! what should I do? please someone answer my question!

constantForce.force is a Vector3. You can add the direction vectors, or construct a new vector3:

// add vectors:
constantForce.force = Vector3.right * Moving.a + Vector3.forward * Moving.b;

// or construct a new vector3:
constantForce.force = new Vector3(Moving.a, 0, Moving.b);

// but use only one of the alternatives above!