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 /
  • Help Room /
This question was closed May 03, 2016 at 06:22 PM by meat5000 for the following reason:

The question is answered, right answer was accepted. Also a duplicate

https://www.google.co.uk/search?q=unity+gun+clip+walls&ie=utf-8&oe=utf-8&client=ubuntu&channel=fs&gfe_rd=cr&ei=SOwoV5SuIqaGgAbJzIv4BA&gws_rd=ssl

avatar image
0
Question by Zitoox · May 03, 2016 at 05:02 PM · cameracollisionobjectclipping

How to make a object collide with the camera?

Ok, i am with a VERY VERY BORING problem here. I am making a FPS and obviously my character have a gun. The probelm is that when i reach in walls,trees,etc the gun pass trough them.

It also happens with the camera. When i reload my weapon it pass trought the camera. I already tried to put a camera in the weapon,make a new layer and all,put a collider but it doesn't work!!

If you didn't understand, just look at the picture. That's my problem .-.

really.jpg (335.2 kB)
Comment
Add comment · Show 3
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 Cherno · May 03, 2016 at 05:44 PM 1
Share

It's a comment problem and you will find many threads about it. There are several solutions. The two most popular are: 1. Render the weapons by a second camera which has a different depth than the main one, and render nothing else (no walls etc.) with it 2. $$anonymous$$ake the viewmodel weapon very small so it fits inside the character's collider (which needs a RigidBody of course). With the right positioning there won't be any difference from the player's perspective.

As for the camera going through walls, check Camera.nearClipPlane

avatar image Zitoox Cherno · May 03, 2016 at 06:00 PM 0
Share

I already tried this and didn't worked

avatar image Cherno Zitoox · May 03, 2016 at 06:01 PM 0
Share

What doesn't work / in what way does it not work, and why do you think it didn't?

"It didn't work" is not helpful.

It's also possible that parts of your animated mesh actually go behind the camera during an animation, in which case you have to move the objects further forward or change the animation.

2 Replies

  • Sort: 
avatar image
0
Best Answer

Answer by Flaring-Afro · May 03, 2016 at 05:47 PM

Try following this tutorial. Hope it helps.

https://www.youtube.com/watch?v=RLzssixo7SE

Comment
Add comment · Show 2 · 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 Zitoox · May 03, 2016 at 06:13 PM 0
Share

After trying several times, It worked by creating 3 cameras. (Do not ask me how I did it) BUT what matters is that it's working!

I realized I had to create and configure some things and edit each layer in half the video. Thank you! ^.^

avatar image Flaring-Afro Zitoox · May 03, 2016 at 08:03 PM 0
Share

No problem, glad it worked out.

avatar image
0

Answer by coolraiman · May 03, 2016 at 05:39 PM

have you tried rigidbody with a collider? also try to lower the near value in the camera properties. the near limit at how close object should be drawn

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

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

2d box collider not working (have rigid body) 0 Answers

Move the Main Camera on Collision 2D 1 Answer

How can I make a third person camera collision script? 2 Answers

Camera Following [2D] 2 Answers

Looking at closest visible object with tag 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