Hello
I need some help, Im devoloping a robot wars game (like the tv show) but i need help with two things like in the show there is a arena flipper which when robots stay on there for 5 seconds it will activate (Robot Wars Arena Flipper - YouTube) is there a script for a flipper to activate 3 seconds after an object is on the colider cos i have the flipper script which is controlled by a key input but i want it to fire automaticly when say a cube or a cylinder goes on to it.
Second:
I would like a ball or some smoke like a pyrotechnic somes out from the pit (Pit Of Oblivion - YouTube) when say cos my robots are controlled by a car object which it still named under car i would like to have a pyro when it goes into the pit is there any way of doing that?
Thanks
you could use the OnCollisionEnter function and yield WaitForSeconds() to check for a collision with the object, and then after a specified amount of seconds, trigger the flipper.
About your second question: I don’t know if I exactly understand what you mean, but you could manage to make the fire and smoke effects using the built-in particlesystem.
I’m not sure that it’s the best option but I will give my ground a tag and like Thurone said create a :
function OnCollisionEnter(other:Collider){
if(other.tag=="ground"){
yiel WaitForSecond (3);
this.rigidbody.AddForce (0,10,0);
}
}
Then For the pyro you could do it with a particle systeme or an animate texture (you got a great example of this in the free sample level of “Shadowgun”, you could find it on the asset store or here).
Hope it helps !!!
Yes, Sorry I’ve made mistakes writting this code, here something working :
function OnCollisionEnter(other:Collision){
if(other.collider.tag=="ground"){
yield WaitForSeconds(3);
this.rigidbody.AddForce (0,200,0);
print("jump");
}
}