Actor moving differently in GS Preview and iPodTouch4 preview

Hi guys,
I'm having a bit of a weird (and highly frustrating issue) with previewing my game, in that it works fine in the GameSalad preview, perfectly, not a single problem! But when tested through and iPod Touch 4 things move out of line seemingly randomly but small increments and break everything.
Basically I've set up buttons that move an actor (block1) left and right to push another actor(ball) down a hole, the actor can only be moves 3 times in either direction and has to always move the same distance. I've then duplicated all these actors and attributes and placed them underneath, so there are 2 actors that can push the ball actor each controlled by two buttons. Using this method to make it work:
Pushing actor (block1):
`
When game.block1moveR is true & game.block1moves < 6
- Change Attribute game.block1position to self.Position.X+50
- Interpolate Attribute self.Position.X to gameblock1position, duration 0.5, linear
- After 0.5 seconds
- Change Attribute game.block1position to self.Position.X-2
- Interpolate Attribute self.Position.X to game.block1 position, duration 0.1, linear
- After 0.6 seconds
- Change Attribute game.block1moves to game.block1moves+1
`
And the reverse to move it the other way. This moves it one direction by 50 and then back the other by 2 whenever a button is pressed, it does this to take a step back from the actor it's pushing so that it is no longer colliding and can register the fall.
block1moves is an integer attribute that counts the number of moves in either direction, to make sure it doesn't go too far either way and is set to 3 by default.
Button actor:
`
When touch is released & block1buttonR is true
- Change Attribute game.block1moveR to true
- After 0.5 seconds
- Change Attribute game.block1moveR to false
- After 0.6 seconds
- Change Attribute game.block1moveR to false
- Spawn Actor (opposite button in correct place)
When Attribute game.block1moveL is true
- destroy this actor
`
The button destroys itself if the other one is pressed which then re-spawns it after the block1 actor has finished moving, this is so you can't press it halfway through the movement and change the directoin making it all go out of line. I tried doing this with a boolean attribute that would disable the button press whilst block1 was moving in the opposite direction, however this made block1 bounce back and forth if you pressed one direction then the other.
I can't see why any of that would make it move incorrectly on the iPod? Currently the actors are all coloured blocks and according to GameSalad there is no drop in frame rate or anything.
I'm not very technically minded so hopefully this all makes sense.
Thanks for your time!
- Olly
I'm having a bit of a weird (and highly frustrating issue) with previewing my game, in that it works fine in the GameSalad preview, perfectly, not a single problem! But when tested through and iPod Touch 4 things move out of line seemingly randomly but small increments and break everything.
Basically I've set up buttons that move an actor (block1) left and right to push another actor(ball) down a hole, the actor can only be moves 3 times in either direction and has to always move the same distance. I've then duplicated all these actors and attributes and placed them underneath, so there are 2 actors that can push the ball actor each controlled by two buttons. Using this method to make it work:
Pushing actor (block1):
`
When game.block1moveR is true & game.block1moves < 6
- Change Attribute game.block1position to self.Position.X+50
- Interpolate Attribute self.Position.X to gameblock1position, duration 0.5, linear
- After 0.5 seconds
- Change Attribute game.block1position to self.Position.X-2
- Interpolate Attribute self.Position.X to game.block1 position, duration 0.1, linear
- After 0.6 seconds
- Change Attribute game.block1moves to game.block1moves+1
`
And the reverse to move it the other way. This moves it one direction by 50 and then back the other by 2 whenever a button is pressed, it does this to take a step back from the actor it's pushing so that it is no longer colliding and can register the fall.
block1moves is an integer attribute that counts the number of moves in either direction, to make sure it doesn't go too far either way and is set to 3 by default.
Button actor:
`
When touch is released & block1buttonR is true
- Change Attribute game.block1moveR to true
- After 0.5 seconds
- Change Attribute game.block1moveR to false
- After 0.6 seconds
- Change Attribute game.block1moveR to false
- Spawn Actor (opposite button in correct place)
When Attribute game.block1moveL is true
- destroy this actor
`
The button destroys itself if the other one is pressed which then re-spawns it after the block1 actor has finished moving, this is so you can't press it halfway through the movement and change the directoin making it all go out of line. I tried doing this with a boolean attribute that would disable the button press whilst block1 was moving in the opposite direction, however this made block1 bounce back and forth if you pressed one direction then the other.
I can't see why any of that would make it move incorrectly on the iPod? Currently the actors are all coloured blocks and according to GameSalad there is no drop in frame rate or anything.
I'm not very technically minded so hopefully this all makes sense.
Thanks for your time!
- Olly
Comments
Maybe the mistake is here?