Character, wizardy and bullet range

Discussion in 'How Can I...?' started by netkomm, Dec 4, 2015.

  1. netkomm

    netkomm Avid Boxer

    Joined:
    Nov 23, 2015
    Messages:
    274
    Likes Received:
    143
    One of my characters needs some help...

    My character needs to physically hit his enemies. For that purpose I have created a transparent bullet. However, is it possible to establish a range for the bullets? Example: I want the hit (bullet) being able to be effective only within a certain range (in pixels, maybe?)

    Now, he's basically throwing a punch on the left screen and the enemy dies on the right side... not cool :D
     
  2. netkomm

    netkomm Avid Boxer

    Joined:
    Nov 23, 2015
    Messages:
    274
    Likes Received:
    143
    ok... I did crack my head a bit and here is the solution I found. Hopefully can be of use to somebody else with the same issue.

    1. I create a transparent ENEMY
    - I made health and damage indestructible;
    - with collision AND kill player option (so it's able to absorb the bullets)
    - movement "fixed" object type "enemy" (so I can carry it along)

    2. I connect this enemy to the PLAYER at the max distance of the bullet

    3. The bullet (animation) is also a transparent PNG

    4. When the real enemy enters within range THEN this one gets the hit and not the "shield"
     
    kpportier and trudnai like this.
  3. Perry

    Perry Avid Boxer

    Joined:
    Oct 4, 2015
    Messages:
    111
    Likes Received:
    31
    @netkomm I thought this was what the strike action was for?
     
    Christoph likes this.
  4. calmackay79

    calmackay79 Boxer

    Joined:
    Dec 20, 2015
    Messages:
    78
    Likes Received:
    150
    I have this for a game also, this method works fine until I use portals, and then it disconnects - making this system not workable for what I want to achieve.

    If you could expand on this it would be great.
     

Share This Page