How would one go about making instantiated bullets collide with gameobjects? And how would I then script a collision detection - is it any different than with non-instantiated objects?
Your question cannot be answered easy. The concept is simple but would be best for you to check out walkerboystudios.com, hover over unity tutorials tab, it drops down and then goton lab 2. it is a 2d space shooter they walk you through step by step to explain things like how to use collision meshes for event triggers. It’s very basic and will get you on your way
Attach this to instantiated bullet.
var maxDistance : float = 10000;
function Update ()
{
var hit : RaycastHit;
if (Physics.Raycast(transform.position, transform.forward, hit, maxDistance))
{
if (hit.transform.tag == "gameObjectTag")
DoSomething();
}
Destroy(gameObject);
}
No differents. First you need to create a prefab bullets, which contains a script in which you have further process collision. Next use Sendmessage or any other convenient method
If your bullet prefab has a rigidbody and a collider attatched, you can use the OnCollisionEnter method to process the collision with another object with a collider. This is probably the easiest thing to do, and is no different to collisions with non instantiated objects.