- Edited
Hi!
I have an issue with enemy type i try to add to learning project I make.
first of all, this is my second game so things are still very confusing sometimes and I can't seem to resolve this issue for weeks now...
What I want:
turret type enemy, that will be spawned in game level (instantiate). > look at player (plane) > shoot on timer >repeat
I made it but it works fine if I instantiate (add) this enemy to game level in editor.
set up that works looks like below:
turret code:
turret enemy nodes:
on signal in game level code:
but If I want to instantiate this through and had to make code just inside enemy then I have problems.
new code as below:
new turret code
node set up
additional line of code in node inside of turret just to turn turret with body
in game look with both turrets which works similar but.
both look at player > shoot on timer
new spawns bullets from center (where projectiles node is made)
old spawns from marker which is supposed to be spawning place
What's the main issue? well the new one hits it's own collision body and self destroys because bullets are spawned inside of it.
what change?