Playmaker Forum
PlayMaker Help & Tips => iOS Help => Topic started by: escpodgames on August 29, 2012, 08:40:04 AM
-
Hi,
I'm a little confused what the Store Delta X and Store Delta Y components of the Get info touch is actually reading.
Does anyone know the difference between Store X and Store Delta X??
Thx
-
Hi,
The "store X" is the actual touch position, where "store delta x" is the distance since the last change
http://docs.unity3d.com/Documentation/ScriptReference/Touch.html (http://docs.unity3d.com/Documentation/ScriptReference/Touch.html)
so as you move your finger, "store x" will be your current screen position while "store delta X" will be the distance travelled since the last frame ( a very tiny amount). This would be 0 if the finger doesn't move.
bye,
Jean
-
Tip. This is really good for dragging (via touch) the camera around in something like a RTS game. Just send the X Y delta floats to the camera position and the camera will move when you drag and stop when you stop or release. You'll need to put the Y float in the camera Z position and you might need to multiply it (multiply by -1, etc if you need to reverse it).
So useful, I use it everywhere now.
-
Thx for the reply guys, This is what I expected it to be but when I tried it, it didn't work :S
I got around it by storing the "store x" in a variable in a state above the "store delta X" ... its just for a prototype so ill revisit it when/if we create the full game.
Cheers