Bullet faces wrong direction on button click

0 favourites
  • 8 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • Hi,

    I've set my spaceship (with bullet movement) to face in the direction of a planet when i click on the planet. I then click on the 'go' button for the spaceship to move.

    When I click this 'go' button, the spaceship starts moving but changes direction to either the centre-left or centre-right far side of the screen (depending whether the planet is on the left or right of screen's centre).

    I hope this makes sense. I don't know whether it's a glitch because i'm not using direct keyboard movements for my ship, but button clicks to activate the movement as well as stop.

    I've gone over my events and also tried a new order to see if it can fix the problem, but whenever I press the 'go' button the spaceship will always sightly change direction. The only way to fix the direction is to click on the planet again while it's moving.

    Thank you for any help

  • I'm guessing you have "Set angle=Yes" in Bullet behavior?

    Make sure the image of the ship (when you double-click your sprite) is correctly positioned. It should be horizontal and facing right.

  • obi554 if you want to move players in direction way you want then try this tutorial and might come up with your own method

    https://www.scirra.com/tutorials/5367/a ... t-2/page-1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm guessing you have "Set angle=Yes" in Bullet behavior?

    Make sure the image of the ship (when you double-click your sprite) is correctly positioned. It should be horizontal and facing right.

    Hi,

    I have the following code:

    1. Planet1 > On click > Bullet > set angle towards Planet1.X, Planet1.Y

    This works fine.

    2. Go button > On click > Bullet > set speed X

    The space ship starts to move, but changes its angle towards the centre of the left/right sides of the screen, and I have to press the Planet1 button again so it can correct it's angle of movement back towards Planet1. It does this same error for all 4 planets.

  • Try setting the speed before you set the angle.

    If speed=0, then Bullet-Set Angle action is ignored.

  • Try setting the speed before you set the angle.

    If speed=0, then Bullet-Set Angle action is ignored.

    Thanks for your message. How do I set the speed first?

  • So you currently have this:

    Planet1 On click -> SpaceShip -> Bullet -> set angle towards Planet1.X, Planet1.Y

    Change it to this:

    Planet1 On click -> SpaceShip -> Bullet -> set speed X 
                        SpaceShip -> Bullet -> set angle towards Planet1.X, Planet1.Y
    
    [/code:1mykf871]
  • So you currently have this:

    Planet1 On click -> SpaceShip -> Bullet -> set angle towards Planet1.X, Planet1.Y

    Change it to this:

    > Planet1 On click -> SpaceShip -> Bullet -> set speed X 
                        SpaceShip -> Bullet -> set angle towards Planet1.X, Planet1.Y
    
    [/code:384e6m8p]
    

    Hiya, thanks.

    I'm currently tweaking different parts of my events because there are lots of different actions that are linked in a chain with my ship movement (power, mineral content, temperature etc) so once I've worked out how the chain links i'll test it out and post results on this thread.

    Thanks again

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