В коде возникла ошибка, transform.position assign attempt for "...." Input position is { Infinity, Infinity, Infinity }. Подскажите, что не так?
код:
using UnityEngine;
using System.Collections;
public class NewBehaviour : MonoBehaviour
{
public GameObject player;
public float speedRotation = 1;
public float speed = 1;
public float jumpSpeed = 1;
float totalTime = 0;
void Start()
{
player = (GameObject)this.gameObject;
}
void Update()
{
{
player.transform.position += (-player.transform.right) * speed * Time.deltaTime;
}
totalTime += Time.deltaTime;
if (totalTime > 5)
speed *= 10;
}
}