Unityscript accessing a Class within a Class

Hi everyone, I have been trying to access the gravity variable in the Character Motor of the first person controller in the Unity standard assets package.

ut I’m not sure how. It’s in another class called CharacterMotorMovement within the class of CharacterMotor and I can’t access it with the getcomponent method.

I simply want to be able to turn off gravity for the controller in a script. So How would I access the gravity variable?

You can access the CharacterMotorMovement like how you would access a variable. If this script is named CharacterMotor.js, then you can do something like this:

var cm = someGameObject.GetComponent.<CharacterMotor>();

//Getting the collisionFlags defined in the CharacterMotorMovement
CollisionFlags cf = cm.movement.collisionFlags;