How to stop a bullet sprite from rotating when moving towards the player sprite?

0 favourites
  • 4 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I'm trying to make an enemy sprite (a mushroom) move towards the player. The bullet is working properly moving towards the player, but then the sprite is rotating. I don't want the bullet enemy sprite to rotate during movement. I used the "set angle towards position" & bullet speed. I also tried using "set bullet angle of motion" & turned off "Set Angle" for bullet behavior, but the enemy just goes to the right or whatever was the directed angle.

  • It's this 'I also tried using "set bullet angle of motion" & turned off "Set Angle" for bullet behavior' but I guess your angle of motion is set to 0 for some reason.

  • lionz So what should I put in to bullet: set angle for motion? I was dumb earlier, and put player.angle, and since my player was always at 0, the bullet went 0 degrees. But I am at a loss at how to now direct the bullet back to the player, using bullet: set angle for motion. I want to do (player.x, player.y) but that isn't an angle. Now the bullet sprite, is not moving towards the player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nevermind lionz, I figured it out. For future reference, this is what I did.

    Even though the bullet: set angle for motion, says angle, you still need to type angle. So put angle(main-object.X,main-object.Y, receiving-object.X, receiving-object.Y).

    So now the bullet will head towards the sprite/object you want to receive the bullet. If you reversed the main-object and receiving-object, the bullet will go the opposite direction.

    Oh, and don't forget to turn off set angle in the bullets behavior box. And make sure to not use or delete any events that use rotate to (receiving object) or set angle towards (receiving object). Just use the steps above.

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