How do I get the bullets to aim in the right direction...

0 favourites
  • 6 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • ...without using the "set angle" action? I want to make sure this projectile stays at the same angle, but travel in the direction of another object.

  • Is that 'projectile' moved by a bullet behaviour or in another way?

    How do you shoot it?

    Is that 'another object' moving ? Is the 'projectile' allowed to mis ?

    Is that 'projectile' allowed to align to its path or does it needs to keep the same angle ?

    Most behaviours have a 'set angle' no/yes switch.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, it uses the Bullet behaviour. It's spawned by a boss, actually. The "other object" is the player, and it only sets its angle when it's first first.

    What I'm trying to do is make it so it moves in the dir of the player, but the sprite itself doesn't rotate. It just looks weird when it does it.

  • Okay, so you want the bullet to change direction towards a moving player, so it wil always hit. Kinda like a heat-seaking-bullet.

    Wel you have the bullet action 'set angle of motion'. That wil ask you for an angle.

    The needed angle you get with an expression. Assuming that the name of the bullet = "bullet' and the name of the player = "player" it is:

    angle(bullet.X,bullet.Y,player.X,player.Y)

    Just fill that in the 'set angle of motion' action.

    Basecaly you use the same tool to change angle as you use to do the motion. If you use 'rotate toward position' (by instance) you rotate the physics world, while you need to rotate things IN that physics world. You will make things go stuck by pushing them into solids, the paths will go erratic, in fact you just break the physics world.

    A little warning; if the bullets always hit, the player goes erratic too.

    Hope i helped.

  • Okay, so you want the bullet to change direction towards a moving player, so it wil always hit. Kinda like a heat-seaking-bullet.

    Wel you have the bullet action 'set angle of motion'. That wil ask you for an angle.

    The needed angle you get with an expression. Assuming that the name of the bullet = "bullet' and the name of the player = "player" it is:

    angle(bullet.X,bullet.Y,player.X,player.Y)

    Just fill that in the 'set angle of motion' action.

    Basecaly you use the same tool to change angle as you use to do the motion. If you use 'rotate toward position' (by instance) you rotate the physics world, while you need to rotate things IN that physics world. You will make things go stuck by pushing them into solids, the paths will go erratic, in fact you just break the physics world.

    A little warning; if the bullets always hit, the player goes erratic too.

    Hope i helped.

    Thank you for the advice. I'm currently away at the moment, but I'll report back with results once I get the chance. Thanks!

  • It works! Which is weird, because I swear I tried that before and it didn't work. Oh well, at least I got it up and running, so that's nice.

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