- if (Input.GetKey(segment.left.keyCode))
- {
- segment.Rigidbody.AddForceAtPosition(
- Vector2.left * (sensitivity * (isRoot ? 2f : 1f)) +
- Vector2.up * (verticalSensitivity * (isRoot ? -1f : 1f)),
- segment.transform.position + (segment.height * segment.forceOrigin));
- }
-
- if (Input.GetKey(segment.right.keyCode))
- {
- segment.Rigidbody.AddForceAtPosition(
- Vector2.right * (sensitivity * (isRoot ? 2f : 1f)) +
- Vector2.up * (verticalSensitivity * (isRoot ? -1f : 1f)),
- segment.transform.position + (segment.height * segment.forceOrigin));
- }
+ segment.moveleft = Input.GetKey(segment.left.keyCode);
+ segment.moveright = Input.GetKey(segment.right.keyCode);