Hi! I am currently working on a flash game with mechanics similar to slither.io, where the player controls a snake-like object and uses its tail to destroy enemies. I have a wave system set up where multiple waves of enemies can attack, and I want to have a moving turret enemy that fires bullets at the player when the player gets near. However, the turret behavior is not working: when spawned, the turrets do not respond to the player sprite, even though I scripted the event: On start of layout -> add "Player" object to targets. I have tried a dummy, and the turrets still don't target anything. I have rotation turned on, and the radius of the turret wide. Can someone please help? Would be much appreciated!
Do you have "On shoot" or "On target acquired" events? Do they get triggered?
Can you share your project file?
Thanks for the reply!
I have the on target acquired event and the on shoot to spawn a bullet on the turret, but they aren't triggering.
I would send you the project file, but I'm not sure now to attach it to the reply textbox.
You need to upload the project to Dropbox, One Drive or similar service and post a download link.
Thank you! I wasn't sure if I was just being dumb and that there was a button...
This should work:
You don't have turret instances when your layout starts. That's why "Add target" doesn't work. Move this action to event #8
Develop games in your browser. Powerful, performant & highly capable.
I moved the event "On Start of layout -> add Player to Targets" to right after the "System -> create object
"TurretEnemy"" event. Unfortunately, the problem still persists :(
No, that's not what I meant. Move the action "Turret add target" inside the event #8, right after the "Create new Turret" action.
Thank you so much it worked!
As you can probably tell, I'm new to Construct, so its awesome that there are cool people to help me out!