Sprite Orienation on movement

This forum is currently in read-only mode.
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • I've not searched the forums before posting this as I'm not sure what to put in a search, so apologies if this has been covered elsewhere.

    I've started a new project and inserted some sprites. The sprites display on the layer correctly, right orientation, but when movement is applied to them, one with a 8 Direction Behavior and the other with an Event to Angle toward the Mouse - both setup directly from the Ghost Shooter Tutorial, each moves to end up at 90 degrees wrong angle.

    Both images that were imported into the Sprites are PNGs.

    So for example, the Turrent points to 90 degrees when the mouse is located at 0 degrees in front of the Sprite.

    The Ship Sprite rotates 90 degrees before then moving according to the Arrow Key being pressed.

  • Update:

    I've sorted the Ship Sprite (8 Direction Behavior) by setting Rotation = None.

  • Try facing the sprite that needs to point to the mouse position to the right, I've found that anything that will act like an arrow needs to face that way to look right.

    If that doesn't help then I misunderstood the problem.

  • Doesn't seem to make any difference once in Runtime state.

    I've attached a screenshot to help show what I'm talking about. http://img.villagephotos.com/p/2005-3/975381/TurretIssue.jpg

    Oh; and I got my degrees wrong, its 270 not 90, or -90

  • Just so it's clear, did you match the angle of your sprite with it's own animation directions? I mean, did you paste an upwards facing sprite into the Right-facing direction? Doing so would cause the exact problem you have. Would need to add an Up-facing direction to solve (and remove the original right), or rotate your image withing the sprite editor.

  • 6Fix, the Animation Angle was the culprit...thus creating a new 270 degree Animation Angle solved the issue...many thanks indeed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hopefully this image explains it a little better:

    <img src="http://i39.tinypic.com/9zm4no.jpg">

    • 1. Draw the sprite so it is facing to the right
    • 2. If you drop an instance on the workspace it will look the same as in the editor
    • 3. But you can still rotate instances to face any angle in the editor
    • 4. The selected instance in this image has been rotated to 90deg - pointing downward
    • 5. For pivoting objects like this, you only need one animation angle:- 0deg, Right

    You can add event code to an object like this to make it point towards the mouse, like so:

    + System: Always (every tick)
    -> Sprite: Set angle towards (MouseX, MouseY)
    This will set the angle to the direction of the mouse pointer, so if you put the mouse on the right of the sprite it will set the angle to 0. This is why you should always draw rotatable sprites in such a way that they point to the right.
    Hope this helps.
  • Cheers, thanks for the explanation.

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