how to adjust gravity using scripts

ok so in the game im making space bar drops a sphere but when 2 are dropped in the space spot my character shoots into the sky so i need to adjust the gravity on “player” how would i go about this?

also the script i made uses rigidbody but for some reason when i move “player” he falls over any way to fix thix i used rigidbody because using transform caused “player” to fall thu the floors and walk thu walls

If Player is all that matters.
Physics.Gravity = Vector3(whatever younwant value);
This changes gravity for all objects using gravity.

If gravity is only to effect a single object while others are not affected, then you could use constantForce.

ok when using the following code attached to “player”

static var gravity : Vector3;
var x = 0;
var y = -100;
var z = 0;

function Update () {
Physics.Gravity = Vector3(x,y,z);
}

i get this following error msg

MissingFieldException: Field 'UnityEngine.Physics.Gravity' not found.
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.Create (SetOrGet gos)
Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.CreateSetter ()
Boo.Lang.Runtime.RuntimeServices.DoCreatePropSetDispatcher (System.Object target, System.Type type, System.String name, System.Object value)
Boo.Lang.Runtime.RuntimeServices.CreatePropSetDispatcher (System.Object target, System.String name, System.Object value)
Boo.Lang.Runtime.RuntimeServices+<SetProperty>c__AnonStorey16.<>m__C ()
Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.SetProperty (System.Object target, System.String name, System.Object value)
gavity.Update () (at Assets/scripts/gavity.js:7)

any ideas?

lower case g

Physics.gravity

Unity Documentation: your friend and helper

lowercase g? o.o how did i miss that

What the f**k…
you are trolling! aren’t you?!

have you tried the lowercase version? I would guess, NO!
Yeah, you are declaring the static variable gravity, but you never use it…

and don’t call me Kid. If you want help, show some respect!

also stupid question probaby but how do u keep a rigid body character from falling over xD

wow lol for one i misread ur post and got mad hence why i edited it and to i didnt think about the lowercase o.o 3 days of no sleep does that to you ya know been working on my game like none stop got so much done and came to that problem and no im not trolling im on a lack of sleep to get alot done and i wrote down the things i ran into problems with did what i was able to and now im here trying to solve the problems i had

wtf

Please don’t necro posts. This is nearly 11 years old.

Thanks.