Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Unity Editor crashes from a seemingly trivial piece of knockback code?

$
0
0
else { Debug.Log("Started attack"); if (setDirection == false) { coll.attachedRigidbody.velocity = new Vector2(coll.transform.position.x - transform.position.x, coll.transform.position.y - transform.position.y).normalized * knockback; } else { coll.attachedRigidbody.velocity = direction.normalized * knockback; } usedColls.Add(coll); Debug.Log("Finished Dealdamage function"); } Hey, so, my unity editor crashes whenever this piece of code gets executed. The weird thing is, when it's executed, it does not execute the first Debug.Log,but then DOES execute the knockback function once before crashing the game entirely. The other code gets run through fine. I already debugged those parts. But once it hits this part, the entire editor freezes, sucks up 4g of ram, and then either I end it through task manager or I wait a few minutes and the editor ends itself.

Viewing all articles
Browse latest Browse all 2383

Trending Articles



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