- Home /
On Collision, Create a Cube?
How would I go about making it so that when the player collides with Cube A, it creates Cube b directly above it?
Comment
Answer by Tim-A · Dec 22, 2012 at 09:55 PM
You would make a Instantiate Script. Then attach it to where you want it to spawn.
var projectile : GameObject;
function OnCollisionEnter(collision : Collision) {
var clone : GameObject;
clone = Instantiate(projectile, transform.position, transform.rotation);
}
Hope that helps. Any questions please feel free to ask.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
I can't get ANY simple collision to work! 3 Answers
Analysing player metrics help 0 Answers
A node in a childnode? 1 Answer
How to destroy bullet on collision! 2 Answers