Need help! why "spawned" sprites shoot in sync?

0 favourites
  • 6 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hey guys,

    Im new to Construct 2, and Ive been stuck on this problem for a while..

    Im trying to get multiple spawned sprites to shoot a target individually, not together

    Any help would be much appreciated!

    Here's the scene file I created:

    The bottom half is my current scene

    dl.dropbox.com/s/3vbo16ghqrs9ppb/Ranged.zip

    The top was a example someone previously posted, that worked

    He suggested me to use "For Each" but it didnt work for some reason..

  •    

    the problem here is that the collision happens on lineofsight object

    so construct has no way of knowing wich player to pick

    by saving uid of lineofsight in playerobject on creation

    then compare if uid of lineofsight = player variable uid, it picks the right player

    hope this helps

    example

  • WOahhh!! thank you sooooo much man!

    Yeah I dont have any experience with Instance Variables, or Arrays yet..

    I feel like thats a whole new technical side of things ><

    What does "nr" stand for?

  • thats the variable i made on the playerobject to save the uid(unique number of that object) of lineofsight object

    "nr" its just a short for "number" but you could name it anyway you like

  • After spawning like a whole army of them on both sides, they seem to stop shooting, and the enemy side just runs straight through...

    Any ideas why that would happen? They are all overlapping the line of sight, why do they suddenly stop functioning?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • can you share the capx where you are, it helps to debug

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)