Replace actor with another actor but spawn new one in center of 1st

Hi, i want to do this:
When i press on an actor that has width, height = 40, i want to destroy it and spawn another actor where its X, Y is the center of the 1st actor.
I am doing so, by destroying it and then spawn the new actor with 0 for its values but the spawning actor is not dead center of the 1st actor...its bit front of it or behind it...
Is there a way to get the exact center of the 1st actor and then when i spawn the second one to place its center to the exact x,y of the first actor ?
The first actor is a movable actor, it has velocity, but thats another thing...i'll deal with that later...for now i just want the "visual" to feel as if the actor is replaced with the new one, without any "jumping" of the x,y values.
Thanks
When i press on an actor that has width, height = 40, i want to destroy it and spawn another actor where its X, Y is the center of the 1st actor.
I am doing so, by destroying it and then spawn the new actor with 0 for its values but the spawning actor is not dead center of the 1st actor...its bit front of it or behind it...
Is there a way to get the exact center of the 1st actor and then when i spawn the second one to place its center to the exact x,y of the first actor ?
The first actor is a movable actor, it has velocity, but thats another thing...i'll deal with that later...for now i just want the "visual" to feel as if the actor is replaced with the new one, without any "jumping" of the x,y values.
Thanks
Comments
kipper
While the 1st actor can be a circle shaped object, the second actor could vary in shape.
kipper
The 1st actor is a circle shape, moving down a slope, and the 2nd actor that spawns in the place of the 1st one is a square.
When the 1st actor is on the ground (no movement) then the 2nd actor spawns perfectly.
But when it is going down a slope, the 2nd one jumps a bit when it spawns and then it resides on the slope.
I just figured out when it does that....its a gamesalad bug
When the actors have a collide rule : actor with tag : XXXX
THEN this happens.
If i set actor of type : xxx then everything is fine.
Weird gamesalad bug....wasted 10h of my life
http://gamesalad.com/game/34984
Search for : Collision Rule in gamesalad to download the project