Game Development Community

Door Problems

by Joshua Steffen · in Torque Game Builder · 08/15/2010 (8:54 pm) · 3 replies

a found a door script but it wont switch my level why?
and here is the link: http://tdn.garagegames.com/wiki/Torque_2D/GenreTutorials/PlatformerAdditional/Doors

#1
08/19/2010 (1:10 pm)
The only way we can help you is if you post your specific code.
#2
08/23/2010 (9:14 pm)
this is the code

function Door::onCollision(%srcObj,%dstObj,%srcRef,%dstRef,%time,%normal,%contactCount,%contacts)
{
if(%dstObj.class$="PlayerClass")
{
sceneWindow2D.schedule(10,loadLevel,"platformer/data/levels/lvl2.t2d");
}
}
#3
08/24/2010 (11:51 am)
Use echo statements to confirm the logic is reaching where you expect:

function Door::onCollision(%srcObj,%dstObj,%srcRef,%dstRef,%time,%normal,%contactCount,%contacts)
{
   echo("Door::onCollision");
   if(%dstObj.class$="PlayerClass")
   {
      echo("Door::onCollision: player");
      sceneWindow2D.schedule(10,loadLevel,"platformer/data/levels/lvl2.t2d");
   }
}