How do I sent angle of bullet towards Hero?

0 favourites
  • 4 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Greetings there! ^_^

    So basically, i want; - When Hero is in line of sight of X - (X is bullet with 0 speed currently) - then set speed to 1000 and 'shoot' towards Hero. Whether Hero is behind or in front, it should shoot towards the Heroes position.

    Whether the Hero is jumping or ducking, it should always aim at the Hero. When i set its angle of motion towards Hero, it keeps going to the right?

    So how to do this?

    Thanks in advance! ^_^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • (If "Hero" is in line of sight) - "X" set speed 1000

    - "X" rotate towards position "Hero.X" "Hero.Y"

    These comands will be repeated each tick the Hero is in the line of sight of the bullet.

    I don't know how to detect line of sight, but the rest should work

  • (If "Hero" is in line of sight) - "X" set speed 1000

    - "X" rotate towards position "Hero.X" "Hero.Y"

    These comands will be repeated each tick the Hero is in the line of sight of the bullet.

    I don't know how to detect line of sight, but the rest should work

    Line of sight is fine, but i cant get the rotation, what u mentioned, the bullet moves only left or right, so if the Hero jumps, it will go under and pass lol.

    Basically, i want when 'Hero is in line of sight' (works fine) - Get object X to move towards Hero. Maybe bullet is not the right way? So far the bullet has 0 speed, but when it has 'line of sight' of Hero, the bullet gains 1000 speed to move rapidly to the Hero, but it keeps going left and right, i cant get it to 'follow' the hero.

  • > (If "Hero" is in line of sight) - "X" set speed 1000

    > - "X" rotate towards position "Hero.X" "Hero.Y"

    >

    > These comands will be repeated each tick the Hero is in the line of sight of the bullet.

    >

    > I don't know how to detect line of sight, but the rest should work

    >

    Line of sight is fine, but i cant get the rotation, what u mentioned, the bullet moves only left or right, so if the Hero jumps, it will go under and pass lol.

    Basically, i want when 'Hero is in line of sight' (works fine) - Get object X to move towards Hero. Maybe bullet is not the right way? So far the bullet has 0 speed, but when it has 'line of sight' of Hero, the bullet gains 1000 speed to move rapidly to the Hero, but it keeps going left and right, i cant get it to 'follow' the hero.

    Oh, then add an instance variable to X, which would get set to 1 when the hero is in line of sight, and then make it so when the instance variable is 1 => "X" set speed 1000 and "X" rotate towards position "Hero.X" "Hero.Y"

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