Sprite - No Rotation. Am I missing something?

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi guys.

    I've got these round sprites that use the Physics plugin, all set up correctly to bounce as they should of various objects, and the result is exactly as I want it.

    The only problem is that I have the shading on the sprite so that the light-source appears to be coming from top-left, and if I tick the No Rotation box of the sprite, the sprites movement is completely different to how it is when No Rotation isn't ticked.

    I assumed that ticking the No Rotation box would not affect the Physics behaviour of the sprite, just the display of the sprite.

    I'm going to have a go right now at trying find a solution, but am I missing something?

    Is there a way to have the sprite act like it was rotating, but the image isn't rotating?

    Krush.

  • Ok, just had a go at enabling the rotation so that I get the movement I require, and updating all the instances of the sprite with angle=0 every tick, and it seems to work fine.

    Maybe reading this will help people who have a similar problem.

    Maybe the Physics behaviour should have a tick-box for physics rotation and another one for sprite rotation.

    Krush.

  • You have to remember that the physics behavior keeps an internal map of all objects that use the behavior, including the angles.

    You might try setting "animation angle", but that only works in 45 degree increments.

    Or you can always use a dummy.

  • My current method seems to be ok.

    If you have a ball shape that bounces with gravity off various objects, you get a nice, realistic look to the movement of the ball, but the sprite itself rotates, which looks odd.

    Imagine a nice 3D Max rendered, shiny metal ball.

    The last thing you want is the ball rotating visually, because you lose the effect of the reflections.

    Ticking the No Rotation box keeps the ball looking like a ball bearing, but the movement of the ball is affected by a considerable amount.

    With shapes other than round balls, I can understand why it doesn't matter, but to keep round objects looking 3d, it would have been useful to keep the graphics separate from the physics rotation.

    No matter though.

    As I say, setting the angle to zero every tick seems to work without a performance hit.

    Krush.

  • You could also make a dummy sprite for the ball "graphic" and have it constantly follow the x,y coordinates of the physics object.

    Whatever works though. If it doesn't affect the performance using an angle reset then that's cool too.

    ~Sol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, my current method seems to be fine with several instances on screen at once, so no problem.

    This morning I did something similar to what you mention with a horizontal moving platform.

    For some reason, adding both a Physics behaviour and a sine behaviour to the same object causes the sine behaviour to misbehave.

    With just the sine behaviour controlling the horizontal movement of the platform on it's own, it moves correctly.

    But with the physics behaviour added too, the sine behaviour causes the platform to not reach it's offset each turn, which means that it eventually edges it's way off screen and doesn't come back. ??

    I solved it by using the dummy with the sine behaviour for position, and the platform for the physics behaviour.

    Krush.

  • Awesome... best of both worlds then eh?

    ~Sol

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