Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

No "AddForce" for Rigidbody

$
0
0
Hi. I started using Unity today and I followed tutorials to get started. i watched basic 10 tutorials for knowing to editor and I am getting to understand it. After that I went to "Project: Roll-A-Ball" tutorial. I followed the instructions exactly and everything was going fine until part where I add force to a Rigidbody in script. At part 8:40 of video he types "rigidbody.AddForce(Vector3);" and when I try to do same, after I type "rigidbody." it opens new menu with options, and there is no AddForce there. If I try to type AddForce, as soon as I hit "A" it says "No Completions Found" and I am only offered these completions (Destroy, DestroyImmediate, DestroyObject, DontDestroyOnLoad, Equals, FindObjectOfType, FindObjectsOfType, Instantiate and ReferenceEquals). Also to mention, in tutorial when he types "Rigidbody" his first letter is lower case and mine changes to upper case and it gets blue like when I type "float", I have Rigidbody as completion. Please tell me what am I doing wrong, I followed instructions well and my script looks exact the same as his except that. Thanks. EDIT: I just fixed it, but. I changed my "Rigidbody" to "rigidbody" without selecting offered completion and it worked. But it changed itself to "GetComponent().AddForce(movement);". Can you explain me why is that? And do I have to type GetComponent for other cases when this happens? Thanks.

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>