[SOLVED] Actor scale bug

Almakos

  • Posts: 632
Hi to all.

If I change actor's scale, various bugs happen.
Misaligned collision shapes (seems collision shape doesn't scale at all), coordinates, where actor is in scene designer and actual position when game is run are not the same...
Anybody else noticed this?

On the attached screenshot knight's scale is reduced to 0.75 and it is obvious that in game knight is lower than should be
Also on the screenshot can be seen weird stretch bug with foreground grass

« Last Edit: June 01, 2012, 01:37:26 pm by Almakos »
Fishing Fantasy Trailer


osiaslemuel

  • *
  • Posts: 370
try to put collision debugger on your scene so you can see their collisions.
also make sure auto-scale collision bounds is "yes"

Almakos

  • Posts: 632
thank you for your suggestion. collision shape seems fine, I've checked.

I have find out that this issue comes from the "origin point" setting.
In scene designer, origin point is not displayed the way as it is set in the actor settings. So if I select "bottom center" it wouldn't be reflected in  scene designer (at least in my case).
So I've put custom origin point roughly in the center of my sprite, and got everything to work as expected.

So that means, that if I want to scale my actors I should set their origin points to center of sprites. That would be easier if stencyl had this option in their origin point settings.

Thank you.
Fishing Fantasy Trailer


osiaslemuel

  • *
  • Posts: 370
Your welcome, happy to hear that your problem is fixed now.  :)

captaincomic

  • *
  • Posts: 6108
There is an option for center origin point (you probably have to scroll up the dropdown to see it). It also should be the default setting, but I think there is a bug that sometimes randomly changes the origin point to something else.

osiaslemuel

  • *
  • Posts: 370
yes, that bug happens to me a few times.

hansbe

  • Posts: 262
Origin seems to be always center for me. I've tried other settings and they dont make a difference. Imo origin of a sprite should be an adjustable x, y coordinate.

Legendary Hoamaru

  • *
  • Posts: 1088
Origin changes are only reflected in game and not in the scene designer due to the way origin points are handled in Box2D.

It's something I can try to work on addressing in 2.2 but it'll more likely be fixed for 3.0 pending on how origins are implemented there.  This is a very tricky one to fix.

Almakos

  • Posts: 632
oopsies..., there is center option and it is set to default...
but I could be able to find it only after restarting stencyl, and I am sure it was not there the first time I watched...
I probably accidentally scrolled it away from center somehow and then due to some reason I could see only 8 options on the bottom of the list
thanks for making it clear to me
Fishing Fantasy Trailer