Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by multinfs · Jun 09, 2012 at 12:45 PM · collisionlagbulletgunshell

Bullet case lagg & collision problem

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?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ExTheSea · Jun 09, 2012 at 02:50 PM 0
Share

Check out this link under Physic $$anonymous$$aterial:

http://unity3d.com/support/documentation/$$anonymous$$anual/Physics.html

I hope this works as I didn't do it myself at this point of time.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Winterblood · Jun 09, 2012 at 03:14 PM

Three things to try:

  • Make sure the casings have the cheapest possible collision geometry - a capsule is probably the best choice. Mesh colliders are very expensive.

  • Give each casing a script that turns the collider off after 5 seconds and deletes the GameObject itself after a minute or so. Otherwise you'll fill the level with casings.

  • Choose a more suitable physics material for the casing and ensure the mass is set very low. You should then get a realistic bounce off the floor. "Bouncy" means rubber :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by multinfs · Jun 09, 2012 at 04:52 PM

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?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Winterblood · Jun 09, 2012 at 09:41 PM 0
Share

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.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Rigidbody of empty bullet shell collision problem. 2 Answers

Making a bullet destroy itself on contact. 1 Answer

bullet desent seem to apear (javascript) 0 Answers

ParticleSystem collision checking. 2 Answers

bullets wont show up 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges