- Home /
Question by
sketchers1 · Jul 23, 2012 at 09:02 PM ·
collisionrigidbodychangeconvert
After Capsule Collision, change into another object.
So I have a series of Capsules that are Rigidbodied with gravity and fall from a space ship in the sky. When they hit the Terrain (Or any other object with a collider) I want them to immediately change into a robot (robo2) how could this be scripted? Thanks!
Comment
Best Answer
Answer by Seth-Bergman · Jul 23, 2012 at 09:08 PM
var robot : Transform; // set this as the robot
function OnCollisionEnter()
{
Instantiate(robot,transform.position,Quaternion.identity); //instantiate robot
Destroy(gameObject); // destroy capsule
}
Your answer
Follow this Question
Related Questions
Helicopter Crash Collision 0 Answers
Spawn rigidbody on collision 1 Answer
Smart camera? 1 Answer
How to move target when it collides with a bullet 1 Answer
OnCollisionEnter function problem. JS 2 Answers