Collision COmponent...CollidesWith
by DINF CLL · in Torque X 2D · 11/12/2007 (5:42 pm) · 2 replies
I am trying to modify de Blaster tutoriel to make new kind of enemi. So I need my projectile to collide with to kind of ennemi.
I read that we can combined TorqueObjectTypes to form a collection of object types with which to collide.
How can I construct that kind of collection...
I search the doc and the forum...nothing on that... I try a few thing like:
projectileObj.Collision.CollidesWith = TorqueObjectDatabase.Instance.GetObjectType("Ennemy1") + TorqueObjectDatabase.Instance.GetObjectType("Ennemy2");
Some one can help me
I read that we can combined TorqueObjectTypes to form a collection of object types with which to collide.
How can I construct that kind of collection...
I search the doc and the forum...nothing on that... I try a few thing like:
projectileObj.Collision.CollidesWith = TorqueObjectDatabase.Instance.GetObjectType("Ennemy1") + TorqueObjectDatabase.Instance.GetObjectType("Ennemy2");
Some one can help me
About the author
#2
1- My enemy can kill each other end I do not want that.
2- When a enemy is firing it is killing himself in fact. Why, because the starting point opf the projectile is the same then then enemy position that is firing. So it collide immediatly with the projectile and killing itself. Setting up the projectile starting point a litle bit in front of the enemy will solve the problem... but not the first problem.
So this is why I have to set up the CollidesWith in the code not in TXB...
Thank's
11/15/2007 (9:04 am)
I already try this solution, but it cum up with 2 problem:1- My enemy can kill each other end I do not want that.
2- When a enemy is firing it is killing himself in fact. Why, because the starting point opf the projectile is the same then then enemy position that is firing. So it collide immediatly with the projectile and killing itself. Setting up the projectile starting point a litle bit in front of the enemy will solve the problem... but not the first problem.
So this is why I have to set up the CollidesWith in the code not in TXB...
Thank's
Associate John Kanalakis
EnvyGames
That should do it. You can do all the same steps in code, but it will take a little longer to type up.
John K.