How to FIX a freakin postion error?

0 favourites
  • 3 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • Ay bois, in my game, you need to shoot some cubes to get money and some other things. The problem here is, when one enemy spawn, he will spawn with an pistol, and, the code that i made works perfectly with the position of it. BUT, when another enemy spawns, his pistol will glitch, and, lock in the place where he just spawned. So, if i have more than 1 enemy spawned, the pistol of the 2 enemy and above will glitch and lock, i tried using UID, but, didn't worked, i tried using iid, and, worked perfectly, BUT, when you kill one cube, everything screws off, i tried using my own created ID, but, like the UID, it glitches anyway. I tried using everything that i thinked, but, i don't know if is an wrong position of the code( lol what a coicidence in event sheet too. ), or the code is wrong, i'm using for each but, it seems to not work too. Please, if you know how to fix it, tell me!

    Code: imgur.com/a/psf4B6h

    Error: imgur.com/a/qmjLe8N

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If every enemy should have a pistol, add them to a container. Then the code will be very simple:

    On every tick - Pistol set position to Enemy.imagePointX("gun"),Enemy.imagePointY("gun")

    You won't need "For each" loop, won't need to link them by UID.

  • If every enemy should have a pistol, add them to a container. Then the code will be very simple:

    On every tick - Pistol set position to Enemy.imagePointX("gun"),Enemy.imagePointY("gun")

    You won't need "For each" loop, won't need to link them by UID.

    Thanks a lot bro! It work!

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