Incase I can find help here, I am having a lot of issues but this is one I'm trying to tackle. I tried making a large cube below the main platform, applied a collider, marked it as a trigger, and turned off the mesh. I wrote this script to see if it would kill the player (angry cardinal) if he fell off and hit the collider but the message doesn't print or it just doesn't work. I was thinking this script would work being applied to the "trigger" (invisible platform), or maybe to the "player" (angry cardinal) but not much luck. Any suggestions or help is much appreciated.
Announcement
Collapse
No announcement yet.
Player won't die when he falls off platform
Collapse
X
-
You're getting the errors because your new DestroyPlayer script works. The problem is that your new OnTrigger script destroys the player (AngryCardinal), but you've told all your badguys to look at AngryCardinal (which doesn't exist anymore).
Change your DestroyPlayer so that it doesn't Destroy the player, and instead jumps to another You Won or You Lost level, and you'll be fine. Or for now, just remove the Destroy(col.gameObject) line and you should be fine.Last edited by Professor Watkins; March 12, 2021, 08:25.
Comment
Comment