turning off gravity for a controller

ok, so I made a third person controller that will be the parent of an object that needs to move on the same plain, unfortunately I can not turn off gravity for it so no matter what it always falls.

I give it a ridged body and unchecked gravity, it still falls

I put in a script to set gravity to 0, it still falls

I change the motor scrip so gravity is set to o, it still F***ing falls

it seems no matter what I do I can not simply turn off gravity for it, I even used the complex motor scrip that lets you turn off gravity, it works, gravity is turned off, but the controller won’t move because it’s not on a solid surface.

basically I need a script that will turn off gravity for a controller, or a way to turn off the gravity, 3 days now of looking at questions like this and non have worked.

I REALLY want to find a way to simply turn off gravity on a controller but still let it move on the X and Z axis and NOT FALL AT ALL UNDER GRAVITY

hope to get acualy usfull answers because I have yet to find one and frankly I am annoyed as hell right now.

some more info, i’m making a project with a space craft that can move forward and back, left and right, but not up and down, it’s third person looking from above and behind, I need it to be able to accelerate, turn, and have the camera follow behind, currently I have a controller than moves the way I need and the camera follows they way I need, but I can not turn off gravity for the controller at all no matter what I do, and I can’t use the other controller script because it doesn’t work in 0 gravity.

here is the script I have for the controller, I need the ability to turn off gravity for it and have it still work and move the object around on the X and Z plain.

var speed = 3.0;

var rotateSpeed = 3.0;

function Update ()

{

    var controller : CharacterController = GetComponent(CharacterController);
     
     
     
    // Rotate around y - axis
     
    transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
     
     
     
    // Move forward / backward
     
    var forward = transform.TransformDirection(Vector3.forward);
     
    var curSpeed = speed * Input.GetAxis ("Vertical");
     
    controller.SimpleMove(forward * curSpeed);

}

@script RequireComponent(CharacterController)

Cydonia,

If you want it to stay on the same y level, you can use the Is Kinematic. This will pretty much keep the character in the air unless the y changes through a script. The X and Z axis
will be able to move freely, but the Y axis won’t move.

Oh, and if this works, please mark it as correct so anyone else who views this will know if it works or not.

If you’re using a character Controller, make sure to set the gravity of the Chracter Motor to zero.

If you have a rigidbody, be sure to uncheck gravity.

alright never mind, I just scrapped the scrip and did some messing around with the 3rd person controller that comes with unity and made it work, thanks anyway for trying.