How do I stop my sprite rotating on start

0 favourites
  • 14 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I am making a TD game and I have enemies spawning at the top left of the screen. They spawn facing the right direction but immediately rotate 90 degrees before they start to move. I know there has to be a quick fix but I cant find it. Please help. Thanks.

  • Yes there is. Open each one up in the internal sprite editor (aka double click them) and change their rotation using the little tools on top and rotate them 90 degrees.

    The "front" of a sprite (ie. 0 degrees) is the right hand side.

    If this doesn't fix it, make sure your not setting an angle somewhere or changing a frame if it has animation.

    If that is not the case attach your .capx file and it should be easy to locate the problem.

  • Thanks for the reply. I wish is was that simple. When my spawn point is on the top of the map, my enemy will rotate 90 degrees no matter what before he starts to move. I made it so that it makes him face the right direction but the rotating is still visible on the screen. I don't want to see it rotating before it starts to move.

    When I place my spawn point on the left side of the screen it will allow my enemy to stay facing the correct direction (the direction I rotated it to) and it proceeds through the path correctly.

    Why does C2 want to rotate my enemy when he spawns at the top but not when he spawns on the left?

  • Hmm without seeing the .capx its tough to guess. One option if its seeing the rotation that bothers you would be to wait a second before making them visible.

    In my space shooter the enemies come from the right side, I flipped all my sprites to get it to work right rather than changing their facing via code.

  • You can add at start of layout set angel sprite 0 or 270 or 180 or something else

  • I'll let you guys know when I get home from work if your ideas worked. Thanks for the replies.

  • I tried the start of layout set angel to multiple degrees but there was no effect at all. My sprites are facing the correct direction before I run the game. The path finding behavior rotates it 90 degrees before the sprite starts to move.

    This doesn't happen when I start my sprite at the left of the screen. Only at the top of the screen. If I set it at the top and have it facing south it will rotate 90 degree to the right (pointed west) and then proceed through the path sideways. So I have it faced 90 to the right so that when it rotates 90 to the left it makes it point in the correct direction of travel which is south.

    If I place the sprite spawn point at the west side of the layout and point it east it will not rotate. It will travel through the path properly.

    I guess I need to know why this does this and if it can be fixed. More complicated then I had thought.

  • If the path finding behavior is rotating the sprite to face along the path you will need to manually change its facing angle.

    If you attach a capx. we can probably solve this for you in no time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • attach a capx please let's see if I can help you otherwise I am sorry cannot help

  • I attached the capx. I pretty much just changed almost everything from an example capx that I have been messing around with. If you move the spawn point from the top of the layout to the side, the tank wont rotate before moving. But if you leave it where I have it you will see that it rotates 90 before it moves. Thanks for the help guys.

  • You can change the angle of the enemy spawner to point in the direction you want them to face when spawned.

  • Try this :

  • You can change the angle of the enemy spawner to point in the direction you want them to face when spawned.

    exactly...

    ..is not a problem in the tank rotation,but in a angle of the enemy spawner..

  • Awesome! I tried rotating the spawner thinking that would fix it. Didn't work of course. Changing the angle did the trick. I set the angel to 90 degrees and it worked for my situation. Thanks for the help guys! Perhaps one day I will be able to return the favor. Thanks again.

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