Touch.pressure was introduced in patch version 5.2.2p1. I am trying to use it experimentally, just to see what is being returned. The Unity editor throws no errors, but when I try to build using Cloud Build (set to Use Latest for Xcode and Unity version) I get the following:
error CS1061: Type
UnityEngine.Touch' does not contain a definition for
pressure’ and no extension methodpressure' of type
UnityEngine.Touch’ could be found (are you missing a using directive or an assembly reference?)
The project is set up to require iOS 9.0 minumum.
Here’s my code - very basic, just updating a UI Text element with the touch pressure every frame.
float touchPressure;
void Update()
{
if (Input.touchCount > 0)
{
touchPressure = Input.GetTouch(0).pressure;
pressureText.text = touchPressure + "";
}
{
There isn’t any documentation about this yet, so any help would be greatly appreciated!