playMaker

Author Topic: Multi-directional shooting  (Read 534 times)

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Multi-directional shooting
« on: January 30, 2023, 08:31:27 PM »
I've been wrangling with this one for a week and still can't figure out how to make this work. I'm trying to get the player to throw/shoot projectiles in the 2d X-axis AND Y-Axis but for whatever reason projectiles only more in either the X or Y when i want it to move in both directions. I've tried everything I could think of. Nothing works. Anyone have any advice?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Multi-directional shooting
« Reply #1 on: January 31, 2023, 02:21:17 AM »
Hi.
Can you give more details :)

how are you shooting (force, velocity, other)
is direction set random / by axis / other

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Re: Multi-directional shooting
« Reply #2 on: January 31, 2023, 04:49:57 AM »
My basic setup is to GetPosition of the player object with a player x position float variable and the player y position variable, then GetPosition of the enemy object with an enemy x position variable, and enemy y position variable, then use FloatCompare so that the player object throws/shoots in the direction of the enem object. It works in one direction but not both.