why does position of an actor change if i attach an animation?

stevehearn

  • Posts: 44
i print the x,y before and after. i lose 20 on the x and 20 on the y. Is there some setting i need to change to make sure that the actor doesnt move when the animation is added?

Hectate

  • *
  • Posts: 4643
If the size of each animation is different, switching animations could cause collisions that "push" your actor away from whatever it collided with. This would mean that the location changes. It could be the floor, or a wall, or both.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

stevehearn

  • Posts: 44
its the first animation after i create it. i removed all other actors and it still does a -20 to both x and y coordinates.

« Last Edit: April 09, 2015, 12:07:48 pm by stevehearn »

LIBERADO

  • *
  • Posts: 2668
You'll avoid a lot of headaches if you keep the same size for all animations.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

stevehearn

  • Posts: 44
in this example i only use one animation. I have other actors in another scene but not this one. I have other animations of different size but they are not used. I dont see how having different sized animations that are not used, or in a different scene can create this 20,20 offset when i load the animation.

Photon

  • Posts: 2697
I take it the animation you switch to is not the default animation? The actor could be getting initialized relative to the default animation and then have its position change when you change to the differently sized new one.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

stevehearn

  • Posts: 44
thats the cause. when i changed the default animation to one of same size there is no position change. thanks.