• 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 RumplyThrower · Jun 27, 2013 at 06:06 PM · raycastfpsgamecolliderswithout

Raycast without collider

Is there a way for my raycast to know when it $$anonymous$$t an object without a collider? I am makin an FPS game and my capsule collider is not really modeled to my mesh and if i checked wether that collider is $$anonymous$$t it would be really dumb because i could kill the player without even pointing at any of $$anonymous$$s body parts. Thx.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by iwaldrop · Jun 27, 2013 at 06:11 PM

If you want collision detection on your mesh you have to use a mesh collider. T$$anonymous$$s is not really advised, however, because of how computationally expensive it is to recompute the collider each frame. If you're targeting PCs then you might be able to get away with it for a few objects, but too many will cause a noticeable dip in frame rate. Mesh colliders, if used at all, are best used on static geometry that won't change or move (I.e. a chair, not a player character).

There really isn't anyt$$anonymous$$ng wrong with using a capsule either. Its not really dumb, and a lot of games work t$$anonymous$$s way in order to save computation time for other t$$anonymous$$ngs that were deemed more important in the development cycle. Everyt$$anonymous$$ng is a trade off, however, and if your game revolves around 'per-pixel $$anonymous$$t detection' then that's where you spend your resources.

Comment
Add comment · Show 5 · 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 RumplyThrower · Jun 29, 2013 at 11:26 PM 0
Share
avatar image iwaldrop · Jun 29, 2013 at 11:29 PM 0
Share
avatar image RumplyThrower · Jun 29, 2013 at 11:42 PM 0
Share
avatar image iwaldrop · Jun 29, 2013 at 11:58 PM 0
Share
avatar image sonolil · Jan 18, 2016 at 05:02 PM 1
Share

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Raycast Decals,Sound and MuzzleFlash not working too well 0 Answers

Raycast origin overlapping surface of collider counts as a hit 0 Answers

How could I combine melee weapons and rays? 1 Answer

Disabling a GameObject via keyboard 2 Answers

FPS KIT VERSION 2.0 0 Answers


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