hello i want to make my character to be destroyed when collisions with an enemy object(something like squid that moves(imported fbx model(no collisions or something)).
What i must do?What collision i must add to the enemy and which script i must put on him?
Aaah i almost forgot…Character has a camera(with camera script to follow the player)if it matters.
Character picture:
You can drag your model to the scene and add a box or sphere collider to it (menu Component/Physics/…). Adjust its dimensions, set Is Trigger in the Inspector and attach an OnTriggerEnter code to it:
function OnTriggerEnter(other: Collider){
if (other.tag == "Player"){ // check if it's the player, if you want
Destroy(other.gameObject);
}
}