Touch.deltaPosition Question

Hello Everyone,

I am trying to learn about Touch.deltaPosition via the Unity documentation at Unity - Scripting API: Touch.deltaPosition. The first code example has a line of code that I don’t understand. The line is:
transform.Translate(-touchDeltaPosition.x * speed, -touchDeltaPosition.y * speed, 0); The part I don’t understand is the negative signs. It seems like that would always move the object from right to left regardless of the actual swipe direction. Why are they there?

Not sure where you found the example, but I guess the intention is to move the object into the opposite direction compared to the touch.

For example: If the touch moves left, delta being [-1, 0], then -delta is [1, 0], thus moving the transform to the right. And if the touch moves right, delta being [1, 0], then -delta is [-1, 0], which moves the transform to the left.

Thank you! That makes sense.