GameObject go = GameObject.Find(“ball”);
go.GetComponent().AddForce(435345);
also tried
go.rigidbody.AddForce(423423);
neither of them worked how would I do this properly?
GameObject go = GameObject.Find(“ball”);
go.GetComponent().AddForce(435345);
also tried
go.rigidbody.AddForce(423423);
neither of them worked how would I do this properly?
The GameObject must have a rigidbody attached in the editor and AddForce takes a vector parameter with 3 elements.
someObject.rigidbody.AddForce(new Vector3(1000,0,100));