Java scripting to change component values

Hi, would like to know how to use a JavaScript to change the component values on a game object in game :face_with_spiral_eyes:. I’m trying to make it that if you press the left arrow key, it will set the hinge joint component’s motor force to -500, and it will turn a rigid wheel to roll left; if you press the right arrow key, the motor force will change the motor force value to +500, and the whell will roll right.

you would first make a variable with that name of component as variable type then call it
var jointComponenet : HingeJoint;
then you would drag the component in it and then just call what you want
jointComponent.Axis = Vector3(0,1,0);

that’s one simple way of doing it other than that look at the manual just type component or get component and it’s under gameobject too in the manual.

Dude, thank you very much!!! I couldn’t do exactly what you told me to do, but you brought me to the right path to sucess!!! I feel like a genius thanks to you. I knowledge in javascripting isn’t even a week old yet and I made it this far. Thank you so much.:smile::smile::smile::smile::smile: