What's wrong with my script? OVRPlayerController has no effect on rigidbody
Hi so i'm just getting back to unity. I'm using Unity 5 because Unity 2017 just didn't work. Im developing for the Oculus Rift.
Here's the simple little thing i want to do. When the player walks up to a rigidbody the rigidbody should disappeaer. (later i'll make it move)
Yes i set the OVRPLayercontroller in the hirarchy to be tagged Player. And yes i added the script to the rigidbodies i want to be affected. Not sure why it's not working. All examples in the web do the same kind of thing.
SCRIPT:
Here's the simple little thing i want to do. When the player walks up to a rigidbody the rigidbody should disappeaer. (later i'll make it move)
Yes i set the OVRPLayercontroller in the hirarchy to be tagged Player. And yes i added the script to the rigidbodies i want to be affected. Not sure why it's not working. All examples in the web do the same kind of thing.
SCRIPT:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RigidbodyPushMe : MonoBehaviour {
void OnCollisionEnter( Collision col ){
if ( col.gameObject.CompareTag ( "Player") )
Destroy (gameObject);
}
}
}