Witam, mam sobie dwa obiekty Jeden to kula a drugi to kamera. Do kuli miałam podpięty taki kod :
using UnityEngine;
using System.Collections;
public class player : MonoBehaviour {
private Rigidbody righidbody;
public float Speed;
void Start()
{
righidbody = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
float Horizontal = Input.GetAxis("Horizontal");
float Vertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(Horizontal, 0.0f, Vertical);
righidbody.AddForce(movement * Speed );
}
}
I wszystko działało. A potem do kamery podpięłam taki kod :
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
public GameObject player;
private Vector3 offset;
void Start () {
offset = transform.position - player.transform.position ;
}
void LateUpdate () {
transform.position = player.transform.position + offset;
}
}
Ten kod kompiluję się bez błędu ale odnośnie kodu podpiętego do kuli pojawił się taki błąd:
<RI.Hid> Failed to create device file:
20 The process cannot access the file because it is being used by another process.
Jak to naprawić ?