- Home /
My rigidbody add force the wrong way it goes down instead of right (2d) Pls help :D
So i have variable that when it reaches a certain value my rigidbody add force to an object \ i want to go this side / but it goes down
public int num = 1;
private Rigidbody2D rb;
public float movement =1.0f;
void Awake ()
{
rb = this.gameObject.GetComponent<Rigidbody2D>();
}
void Update()
{
if (num < 4);
{
num = (num + 1);
};
if (num == 4);
{
rb.AddForce(-transform.up * movement);
};
}
};
Answer by Captain_Pineapple · Sep 06, 2020 at 06:57 AM
so if it goes down when your direction is negative up (-transform.up) and you want it to go right then which direction do you need? (transform.???)
I'll leave the rest for you to answer yourself.
Your answer
Follow this Question
Related Questions
increasing knockback of a rigidbody as received damage increases (like super smash) 1 Answer
Rigidbody 2d add force horizontally affecting vertical velocity 1 Answer
Unity 2D Apply force in Z Direction 0 Answers
How to disable transfer of force between two 2d rigidbody ? 1 Answer
How to not get velocity by the other objects?,How to not get force by other gameobjects? 0 Answers