- Home /
Script making characters fall through ground
Hello again, so recently I got some fantastic scripting help from Nequium, and he provided me with this script in which I have my player destroy when his head armature + collider collides with anything
//Drag your MAIN player object into the variable below AFTER you've attached this script to your player's head
public Transform player;
void OnTriggerEnter(Collider other) {
Destroy(player.gameobject);
}
Now, this works very well, apart from the fact that when I hit player the player will fall through the world, and anything (with a collider, with a rigibody, anything). Now, the odd thing is, I have several other versions of him at the exact same height that are identical other than the fact that they dont have this script, and they work just fine. If you guys know how to fix this it would be a fantastic help, because its stumped me.
Answer by NecrosDk · Apr 06, 2014 at 05:16 AM
Did you set the collider of the player to isTrigger? If so he will go through everything.
That would be it, I feel like such a fool for not even trying it out first. Sorry to bother you/
hi, i can't seem to find how to turn isTrigger off, I'm a noob at this btw, also, i can barely see any character options besides controls
@Charile_The_$$anonymous$$ic - On the collider on the object (assu$$anonymous$$g there is one), this is an isTrigger option.