Moving a box with your finger WITHIN the camera

juzcookjuzcook Member Posts: 259
edited November -1 in Working with GS (Mac)
Hi guys, my problem at the moment is moving a box with my finger in a sidescrolling platform game. I've got the basic rules down where the box moves using these rules:

When Touch is pressed:
Constrain Attribute: [Self.Motion.Linear.Velocity.X]
To: [(Game.Touches.Touch.1.X) - (Self.Position.X)

Constrain Attribute: [Self.Motion.Linear.Velocity.Y]
To: [(Game.Touches.Touch.1.Y) - (Self.Position.Y)

Else: [Change Velocity to zero]

So my problem is that the box moves perfectly when in the bottom left hand corner of the level, but nowhere else. For example if I place the box anyway beyond X=500, Y=500, the box seems to think that I'm touching the screen way back at the start of the level. Can anyone see where I might've gone wrong? I hope I made this clear enough!


Sign In or Register to comment.