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

Can't understand error message

$
0
0
I'm making a 2d platformer game using c# and I've got this error message that I don't understand how to fix it. There aren't any red squiggly lines under the code. Here's the error message: NullReferenceException: Object reference not set to an instance of an object Bounce_pad.OnTriggerEnter2D (UnityEngine.Collider2D other) (at Assets/Sripts/Bounce_pad.cs:14) ---------- Here's the code I'm currently using: private Rigidbody2D rigidbody2d; void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { float BounceHeight = 10f; rigidbody2d.velocity = Vector2.up * BounceHeight; } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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