- Home /
Horizontal gravity on One gameobject
Hey guys im new with unity. Right now im making a simple 2D game. I want to set the gravity of a rigidbody which belong to a certain gameObject. The standard rigidbody pulls down the gameobject but i want to set the gravity to pull the gameObject to the left. I know how to do that in edit - project setting... but that will set the gravity on every rigidbody i have which is a problem in my case. Hope u guys can help, thx u.
Answer by MelvMay · Apr 16, 2015 at 12:55 PM
You already asked this here and it was answered already so why ask again now?
http://answers.unity3d.com/questions/948189/change-a-specific-gameobjects-rigidbody-gravity-to.html
Please stop double-posting.
Answer by Ekta-Mehta-D · Apr 16, 2015 at 12:55 PM
Void Update()
{
rigidbody2D.AddForce(Vector2.left * 9.8f);
}
Your answer
Follow this Question
Related Questions
My 2d spawned bullet prefabs will not fly up, just fall 3 Answers
how to jump at fixed height but faster 0 Answers
jump script : 2D 1 Answer
Script for alternative gravity? 2 Answers