Learn to program, I don't wanna sound like a dick but no-one else is saying it so I will. You're having way too many problems with way too basic of a script and you seem to be blindly doing what we say rather than understanding what we're telling you. So sit yourself down, and learn to program. If you're doing this to…
Ok so I made the my "Bullet" (Prefab) a gameobject and I attached my code to the gameobject Here is my code: #pragma strict public var prefabBullet:Transform; //object to create public var bulletSpawnPoint:Transform; //place to create object public var shootForce:float; //speed of object function Start () { } function…
Hey everybody I'm just trying to have my bullet destroy on impact. My bullet is a prefab. Here is my unity screen Here is my code: public var prefabBullet:Transform; //object to create public var bulletSpawnPoint:Transform; //place to create object public var shootForce:float; //speed of object function Start () { }…
Lamont while I agree with everything you said someone who has code that says Needs to learn to program. That if statement lacks curly braces, so it's only gonna grab the next line which means it's going to suck up the variable declaration. Now, depending upon your language that may just be an assignment but either way when…
Not "learn how to program", but "know how to find/research". Destroying objects is a very common question in the Unity community. The Unity Online Reference is extensive and documents almost everything ,there are the few obscure things that are not documented well, but it works. Object Destroy - Link. Programming does take…
the null references are because the new script has a bunch of stuff it doesn't need to just destroy the bullet (it's actually trying to create another bullet as soon as it's spawned, most likely, because you still have that code in the update function of the bullet collision script). instead, keep the bullet shooting…