Forum Discussion
nerdVRBuddy
8 years agoProtege
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);
}
}
}3 Replies
Replies have been turned off for this discussion
- nerdVRBuddyProtegeDoes anyone know or have a clue of what's wrong and why it doesn't work. It's puzzling to me.
- AlanOTooleAdventurerJust 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.
- nerdVRBuddyProtegeThe 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
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 months ago
- 10 months ago
- 9 months ago
- 8 months ago