[SOLVED] Destroying the OVRPlayer Controller/freezing issues
Hi,
I did not find any post on this topic so I made a new tread.
When I destroy and Instanciate the OVRPlayer Controller it freezes.
No inputs what so ever possible but the game is still running.
I thought one of my scripts or the altered PlayerController.cs (commented out the keyboard inputs) may cause the issue so i made a virgin scene, same issue.
before my rift arrived I used this (js) to respawn the player:
Instantiating the OVRPlayer Controller works (even as many as I feel like).
When I Instanciate it the prefab (or all of them) respond to the Controller(xbox) and sensordata.
I got the Problem down to:
Does this work for you?
Any idea how to fix this?
Kind regards
Felix
I did not find any post on this topic so I made a new tread.
When I destroy and Instanciate the OVRPlayer Controller it freezes.
No inputs what so ever possible but the game is still running.
I thought one of my scripts or the altered PlayerController.cs (commented out the keyboard inputs) may cause the issue so i made a virgin scene, same issue.
before my rift arrived I used this (js) to respawn the player:
var prefab : Transform;
var clone : Transform;
function OnTriggerEnter (other : Collider) {
if(Globals.Lifes > 1){
Globals.Lifes -= 1;
Destroy(other.gameObject);
Instantiate(prefab);
clone = Instantiate(prefab);
FollowPlayer.target = clone;
//for testing
print("Lifes: "+Globals.Lifes);
}
else{
Destroy(other.gameObject);
Globals.GameOver = true;
}
}
Instantiating the OVRPlayer Controller works (even as many as I feel like).
When I Instanciate it the prefab (or all of them) respond to the Controller(xbox) and sensordata.
I got the Problem down to:
var prefab : Transform;
function Update () {
if (Input.GetButtonDown ("Fire1")) {
Destroy(this.gameObject);
Instantiate(prefab);
print("test");
}
Does this work for you?
Any idea how to fix this?
Kind regards
Felix
