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

Game crashes when 3 gameobjects collide at the same time.

$
0
0
So I made a game where enemies follow you but I decided to teleport them away whenever they collide with eachother but when 3 enemies collide at the same time the game crashes. void OnControllerColliderHit(ControllerColliderHit hit){ //part that does a game over, don't think is relevant if (hit.gameObject.tag == "Player"){ StartCoroutine(hit.gameObject.GetComponent().callDeath()); } //part that teleports the enemies away if (hit.gameObject.tag == "enemy_strong"){ Vector3 NewSpawnPos = new Vector3(characterController.transform.position.z + 30, -0.78f, characterController.transform.position.x +30); characterController.Move(NewSpawnPos); } }

Viewing all articles
Browse latest Browse all 2383

Trending Articles



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