How To Target And Shoot At Cloned Objects?
by Jack-S- · in iTorque 2D · 02/24/2012 (12:41 pm) · 1 replies
Hi, I have problem here which involves the turret behavior, ( I could have also used the timer shoots) however problem is, I have a spawner sceneObject which spawns enemies which are cloned from an enemy somewhere off screen. trouble is my turret will only shoot at the original object which the clones are cloned from with the spawn area behavior and not the cloned enemies.
Does anyone know how to get around this??
Thanks in advance.
Does anyone know how to get around this??
Thanks in advance.
About the author
Torque Owner Joe Williams
Newborn Games
%newEnemy = Enemy.clone();
Turret.target( %newEnemy );
In the above example, Enemy.clone() returns a reference to the cloned Enemy object and Turret.target( %newEnemy ) assigns the clone reference as the target (you have to make the target function, of course).