Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Eugene · Mar 20, 2010 at 08:25 PM · collisionphysicsfpstutorial

FPS Tutorial: Why do my grenades go through the walls?

I have set up the missile launcher and added the script to instantiate a grenade and change its velocity but the grenades just go right through the walls, about 90% of the time sometimes they hit the wall but then they just fall through the floor lol.

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by e-bonneville · Mar 20, 2010 at 10:17 PM

There is a common problem that is the cause of this. It is called "collision tunneling". It happens when the projectile is moving so fast that one frame it is directly in front of the wall, and the next, it has passed right through it.

This script may be of use to you:

function FireOneShot () { var direction = transform.TransformDirection(Vector3.forward); var hit : RaycastHit;

// Did we hit anything? if (Physics.Raycast (transform.position, direction, hit, range)) { // Put your firing script here }

That uses a raycast to tell if the grenade hits anything an instant before it does. Give it a try... Good luck!

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 Eugene · Mar 20, 2010 at 11:29 PM 0
Share

Ah ok thanks, I assumed that PhysX would handle quantum tunneling.

avatar image
0

Answer by patricklorio · Mar 20, 2010 at 10:09 PM

In the game's settings there is a tab called time. In that you can play around with the sub settings. the lower the number, the better the physics. I don't have unity on this computer so I cannot see exactly which one determines the physics or time but I think it is the second text field. Remember don't go crazy with the number cause it eats up the memory.

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 Eugene · Mar 24, 2010 at 10:02 PM

Taken from the Unity3D car tutorial (http://www.gotow.net/andrew/blog/?page_id=78):

NOTE: I generally create colliders as separate child objects of the main body, this way I can have multiple colliders in the general shape of the car. You could use a mesh collider for this, but mesh colliders do not work well for objects moving at high speeds.

Perhaps this explains why my grenades go through the walls because I am using a mesh collider for the level object. It seems like a real pain to set up individual box colliders for the entire level mesh in Unity, is there a way to do this in Blender or an external 3D app? If not perhaps this would be a good addition to the program...

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

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

No one has followed this question yet.

Related Questions

is there a way to move a rigidbody with something like moveposition without clipping through collider? 1 Answer

overlapsphere to destroy NPCs on exit 1 Answer

Collision impact force 1 Answer

I want my Player to have collision physics 1 Answer

How may I observe expected physical interactions while using Rigidbody.MoveRotation()? 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