Hi and thanks in advance.
I am getting this error code
“transform.position assign attempt for Player(Clone) is not valid. Input position is {NaN NaN NaN}”
this only occurs when I try to implement my pause function (which is using time.timescale = 0).
The entire game movement is based on tapping the screen
I have tried setting my pause function to a button as well as to two fingers touching the screen at the same time.
What’s confusing is that, as long as I remove the time.timescale = 0 aspect, I do not get this error. Once i reintroduce it, i get the NaN problem again.
below is my movement method which is based on a single touch, my time.timescale method and my pause method which is based on 2 fingers touching.
private void Update ()
{
if (Input.touchCount > 0)
{
Touch _touch = Input.GetTouch(0);
Vector3 _touchPosition = Camera.main.ScreenToWorldPoint(new Vector3(_touch.position.x, _touch.position.y, 10));
_myPosition = _touchPosition;
}
}
private void Update()
{
if (NinjaTimeOn == true)
{
Time.timeScale = .5f;
}
else if (_uIManager.pauseMenuVisible == true)
{
Time.timeScale = 0f;
}
else
{
Time.timeScale = 1;
}
private void Update()
{
if (Input.touchCount > 1)
{
//Touch touch = Input.GetTouch(1);
_uIManager.pauseMenuPanel.SetActive(true);
_uIManager.pauseMenuVisible = true;
}
}