How do I set a bullet to go to player location?

From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Hi.

    I'm trying to make a Zelda-type game for a Gamejam, but the enemy AI is refusing to work.

    Right now, I have a sprite acting as a "bullet" that moves toward the player when within a certain range, and stops when they aren't. (Other enemies will come later.) The problem is that in my current project file, the enemy "bullet" is only moving to the right. I believe I need to use this:

    Set Bullet angle of motion to angle(Zombie.X, Zombie.Y, Player.X, Player.Y)

    Changing Zombie out for my enemy, and Player for my player name. I cannot use that, though, because Construct 2 is saying that there is a syntax error, so the closest I can get is:

    angle of motion to angle(EnemyNameHere.X)

    Because for some reason...

    angle of motion to angle(EnemyNameHere.X, EnemyNameHere.Y, PlayerNameHere.X, PlayerNameHere.Y)

    ...highlights the first comma and says it's a syntax error, and "did I forget something" or something to that effect and it's really starting to get on my nerves.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Looks fine to me. Let's see a screenshot of the data you are using and the syntax error.

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