|
I am trying to do simple throwing of crates and seen this from tornado twins. Here is the script and it gets error : "Null Reference exception: Object Reference not set to an instance of an object."
(comments are locked)
|
|
You've wrote crate.Rigidbody while the correct is crate.rigidbody (Rigidbody is a type). The correct form is: crate.rigidbody.AddForce(transform.forward * 2000);Remeber also that your crate prefab must have a rigidbody for this to work.
(comments are locked)
|
|
It doesn't show anything still does the same thing. It is shooting it's just shooting up along with the y axis and it's shooting with an akward interval. Shoots one that doesn't go normal and stops and when second is shot it pushes the first. Add comments as comments, not as answers.
Jul 20 '11 at 02:24 PM
almo
I cannot seem to add a comment to the replies i get that's why i'm posting as answers
Jul 20 '11 at 02:28 PM
TheKnight
Just click the "Add New Comment" button.
Jul 20 '11 at 02:47 PM
almo
To me this only seems to work on my posts not for example on aldonaletto post.
Jul 20 '11 at 03:04 PM
TheKnight
If it's like that, isn't that a little stupid? Users get downvoted just because they are posting new replies instead of commnents while they can't post.
Jul 21 '11 at 12:00 AM
TheKnight
(comments are locked)
|
|
aldonaletto - That did the trick. But in the tutorial I watched it was Rigidbody and it worked. It's case sensitive? In the editor if I write it as Rigidbody it turns blue, if not it doesn't turn any color. Yes, Unityscript is case sensitive: Rigidbody is a type, while rigidbody is one of the transform variables. I don't know why the editor didn't turned it to blue - it should, since it's one of the words it "knows" (it's blue in my editor).
Jul 20 '11 at 02:58 PM
aldonaletto
(comments are locked)
|
