Multitouch - 2nd touch replaces attribute of 1st touch

jrj.clarkjrj.clark Member, PRO Posts: 17

Hi there,

I have a relatively simple game where I'm moving an actor from one side of the screen to the other (along the x axis).
I've created the following rule:
-When actor receives Touch is pressed
--Constrain Attribute self.TouchX to game.mouse.position.x

Then, if x is below half the screen width, the actor will move left. If x is greater than half the screen width, the actor will move right. That all works fine.

However, I notice in gameplay, I'll often have one finger pressed down to move left, and then I'll place my second finger on the screen to move right momentarily before I release my first finger. Instead of moving right, 'TouchX' remains the same and I continue to move left.

I want TouchX to update with the value of the 2nd finger when placed on the screen. Or more generically, I want TouchX to take the value of the last finger to be put on the screen.

Thanks,
James

Sign In or Register to comment.