I tried looking through previous questions to avoid repeates but I haven’t found one yet… If there was then i apologize and would appreciate it if I was redirected there.
But here is my question. I’m trying to make the platform explode/detonate when the player, it’s a First Person Controller,collides with it. In other words, when the player jumps on top of the platform, the platform will detonate.
There will be multiple platforms but i’m trying to get one working as of now.
I have made a separate empty object called PlatformExplode and a script “explode” associated with the empty object with this in it
Ensure both player and enemy have colliders attached and attach this script to your player.
On a side note; try adding some de-bugging to your scripts to find out where the problem lies, this will let you know if it’s the trigger or the instantiate that isn’t working.
function OnTriggerEnter(other:Collider)
{
if (other.tag == "Player)
{
// Code for detonation
}
}
Before you try it, click on your character in the inspector and on the very top menu, change the tag to “Player” so this works.
I don’t know how to code the detonation, so if you know how just put it in there.