Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Error : Object reference not set to an instance of an object body.Update

$
0
0
My unity is with the following problem: NullReferenceException: Object reference not set to an instance of an object body.Update() (at Standard Assets/Assets/Menu/corpo.js: 20) Tags and some elements as in Portuguese of Brazil #pragma strict var Vida: float; var TVida : TextMesh; var TempoQueda: float; function Start () { Vida = 100; TempoQueda=-1; } function Update () { if (TempoQueda>=0) { TempoQueda += Time.deltaTime; } TVida = transform.GetComponentInChildren(TextMesh); TVida.text = "Vida: "+Vida; } var testeInpacto : Vector3; function OnCollisionEnter(collision: Collision) { testeInpacto = collision.impactForceSum; if (testeInpacto.y<10) { if (collision.transform.tag!="agua") { if (TempoQueda>1) { Vida = Vida - (100 * (TempoQueda/3)); } } } TempoQueda=-1; } function OnCollisionExit(collisioninfo : Collision) { TempoQueda = 0 ; }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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