Search Unity

Shooting Bullets

Discussion in 'Scripting' started by Andre Gregoire, Oct 19, 2009.

  1. Andre Gregoire

    Andre Gregoire

    Joined:
    Aug 28, 2009
    Posts:
    32
    I have this problem, i have bullets made of a RigidBody(and a Collider) (IsKinematic=false,Because i want to hit the character,OnCollisionEnter()) but i realized that when i use AddForce only the rigidBody goes along not the mesh.

    Do i have to use translate(mesh) and addForce (physics) to move all the objects besides the characters? Is it like the transform moves everything but the Add force not? Or is there something i missed?
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Things like this can happen if your object has a hierarchy of child objects and the rigidbody is on the wrong one, or if there is more than one rigidbody in the hierarchy. The first thing to check is that there is only one rigidbody component on the bullet object and that it is attached to the root object.