- Home /
FPS TUTORIAL HELP
First post woho (not sure if this is right forums but any way)
any ways im folowing the FPS tutorial on the unity site and im stuck on this point
"Now we can assign the explosion to the missile:
Ensuring that Missile prefab is selected, fill in the Explosion variable by dragging the Explosion object in the Project panel onto the Missiles Explosion variable in the Inspector panel."
Were is the Explosion variable in the instector panel? (A picture or better instructions on what to do)
Answer by GesterX · Feb 09, 2011 at 08:54 AM
You first need to add Projectile.js to the missile by either dragging it on to it or going to Component > Scripts > Projectile whilst the missile is selected. Once you have attached the script you will see the Explosion variable as part of the Missile's Projectile.js component.
If you still don't see the variable then make sure you have the following in Projectile.js:
var explosion : GameObject;
function OnCollisionEnter( collision : Collision ) { var contact : ContactPoint = collision.contacts[0]; var rotation = Quaternion.FromToRotation( Vector3.up, contact.normal ); var instantiatedExplosion : GameObject = Instantiate( explosion, contact.point, rotation ); Destroy( gameObject ); }
Your answer
Follow this Question
Related Questions
using c# for fps tutorial 2 Answers
Moving my object toward a position even though it's not facing that position. 0 Answers
How to display Gui for clips left - FPS tutorial 0 Answers
Missile launcher is malfunctioning 2 Answers
How do I make a FPS Boss? 1 Answer