transition.to positioning incorrect

I’ve noticed when using transition.to to move an object, the object’s new position is not correct, usually off by a fraction of a whole.

Generally speaking this might be ok, but if you are trying to move along a grid this gets dicey very quickly. Compare transition.to with moving an object by setting it’s position directly and the issue becomes clear.

I prepared two examples to visualize the issue:

http://screencast.com/t/ovAKJWLO2
In this example one object is moved with transition.to and the bottom by setting the .x directly - Console prints positions of both white boxes

http://screencast.com/t/Rd8GpNByH
Finally in this example the white object, matching the red in size, is moved around the red.With each movement the position of the red is affected more and more drastically. This is using transition.to, the issue does not arise when setting the position directly. [import]uid: 66672 topic_id: 14265 reply_id: 314265[/import]

is that slight change in position because of physics ? [import]uid: 71210 topic_id: 14265 reply_id: 52617[/import]

No, the incorrect positioning happens with or without physics. [import]uid: 66672 topic_id: 14265 reply_id: 52621[/import]

can I just see the code with that problem ? may be if you can provide just the transition and printing part of the code. [import]uid: 71210 topic_id: 14265 reply_id: 52625[/import]

I moved on and the code has been edited since, but this should do it.

[lua]local function moveDown(e)
if(e.phase == “began”) then
print(“move down”)

player_is_y = player.y

print(player_is_y)

thisPos = player_is_y + 48
transition.to( player, { time=500, y=(thisPos)} )
end

end[/lua]

Tied to a simple button press [import]uid: 66672 topic_id: 14265 reply_id: 52626[/import]