I am quite new to coding, have learned quite a bit of javascript. Has anyone got a solution to Obituaries Gui, In other words how does it know my bullet killed the enemy and display it on screen that ive killed a certain player.
the bullet has rigidbody, you can use OnColliderEnter function and declare inside that function the object who is the impacted object:
this code must to be attached to the bullet…! :
function OnCollisionEnter (enemy : Collision){
guiText.text = "The bullet has collided with " + enemy.gameObject.name
}
depending to what enemy have you fired, the enemy name will be written on the guiText (on screen)…
greetings!