Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
nerdVRBuddy's avatar
8 years ago

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:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RigidbodyPushMe : MonoBehaviour {
void OnCollisionEnter( Collision col ){
if ( col.gameObject.CompareTag ( "Player") )
Destroy (gameObject);
}
}

}







3 Replies

Replies have been turned off for this discussion
  • Does anyone know or have a clue of what's wrong and why it doesn't work. It's puzzling to me.
  • Just out of curiosity, does the Player object also have a collider? Another thing too is to make sure that, if it does have one, it is actually touching the other collider / Rigidbody.
  • The Player controller is a capsule character controller. but it doesn't have a collider.
    I don't understand why it's not working no matter what