|
I have a gun that shoots bullets and ejects shells from a empty gameObject's position next to the gun. Now, the problem is that I want the shells to like bounce a little and maby roll over if another one hits it, I tried with setting the Mesh Collider to be Bouncy but it just keeps bouncing very high. And another problem is that after about 60 shells are ejected on to the ground it starts to lagg, like to 5fps and I dont have a slow pc. Is there any other way of keeping many bullet cases on the floor without them taking too much of the pc's performace?
(comments are locked)
|
|
Three things to try:
(comments are locked)
|
|
well if I set the mass to be lower I'd have to decrease the force added to it after it has been ejected. But I'll try Thanks for your answer :), The capsule collider made it alot less laggy. EDIT: 1)Btw if you turn off the collider doesnt it make the case fall down through the floor?? 2)The bullets that are falling from the gun are stopping the character from moving through them, Is there a way to make the bullets just bounce off the player instead of stopping it? 1) Sorry, yes - you'll need to turn off the rigidbody too. You want them active long enough to bounce and settle on the floor, then they just render for long enough for the player to move on. You won't be able to kick them around, and if you wait long enough you'll see them vanish, but it'll keep the framerate up. You could make them wait until they're offscreen before deleting them if it matters. 2) I'd recommend just letting them pass through the player, it's much easier. Create a couple of layers called "PhysicsDebris" and "Player", set the casings to one and the player capsule to the other. Then go into Edit->Project Settings->Physics and uncheck the box that allows collisions between those two layers.
Jun 09 '12 at 09:41 PM
Winterblood
(comments are locked)
|

Check out this link under Physic Material:
http://unity3d.com/support/documentation/Manual/Physics.html
I hope this works as I didn't do it myself at this point of time.