Skip to main content
Inspiring
March 28, 2018

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);
}
}

}







    This topic has been closed for replies.

    3 replies

    Inspiring
    March 29, 2018
    Does anyone know or have a clue of what's wrong and why it doesn't work. It's puzzling to me.
    Inspiring
    March 29, 2018
    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.
    AlanOToole.com Twitter: @Alan_OToole
    Inspiring
    March 29, 2018
    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