Keeping a rigidbody still

Howdy.

I have an Zombeh that I am shooting at (instantiated bullet prefab)
But when the bullet hits the zombehs, they just spin out and start floating away. Gravity is turned on. I need to keep the rigidbody on them for collison and stuff, but how would I keep these guys still why being shot.

Let me rephrase that. I want them to get pushed back a tiny bit when they are hit, but these guys are just flying away and spinning.

I was thinking I could change the rigidbodys to kinematic and then handle the movement through rigidbody scripting.

Here is my script:

static var player : GameObject;
var tplayer : Transform;

var speed : float = 1;



function Start ()

{

     player = GameObject.FindGameObjectWithTag("Player");      

}



function Update()

{



         //Debug.Log ("player is close");     

          var delta = player.transform.position - transform.position;

          delta.Normalize();       

          var moveSpeed = speed * Time.deltaTime; 

          transform.position = transform.position + (delta * moveSpeed);		  

		  transform.LookAt(tplayer);

}

The collision with the bullet and zombie is handled in another one of my scripts.

Also, How would i make it so that these guys don’t rotate up towards my player when they get close? I cant restrict rotation on the Y axis or else they wouldn’t be able to rotate correctly.

You can lower the mass of bullet’s, if the bullets are actually hitting the zombies. Else tell us how the bullet works.

I actually fixed the problem I think, but I just caused new problems.

I will try to lower the mass of the bullets, thanks.

EDIT:

It turns out the bullet didnt even have a rigidbody. Adding a rigidbody to this solved the problem.

Thanks!

Set the collider to Trigger, then it will still collide with the zombie (although using OnTriggerEnter instead of OnCollisionEnter) and you don’t have to deal with the zombie being catapulted into space.