- Home /
Enter Trigger and Rigidbody Enable
Hey, can you help me how to make a rigidbody script. When you enter the trigger, rigidbody in this (gameObject) will enable
I know there should be a var of object but I don't know rigidbody part ..
Comment
Best Answer
Answer by TheRichardGamer · Dec 16, 2013 at 09:14 AM
Make a trigger and attach this script:
var yourObject : GameObject;
function OnTriggerEnter(Other : Collider){
if(Other.gameObject.tag == "Player"){ //Be sure to tag your player to "Player"
yourObject.rigidbody.enabled = true;
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613124254im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How to tilt the gameobject based of Input.Acceleration? 0 Answers
How can I make a character bounce? 1 Answer
Problem with array on gameobjects 2 Answers
if moving statement 1 Answer