Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 KROEYF · Jul 22, 2015 at 03:13 AM · fpsgunclipping

Gun still clips through the wall despite layer masks being applied

Hi, I've been working on a first person shooter for a while, and have been having an issue where my gun clips through the wall. After searching through the internet, I found a solution which uses layers in order to render the gun over everything else, but now I can't even see the gun at all. It's been extremely frustrating and I would like some help from you guys. Here are some photos of the settings: http://imgur.com/a/UThCb

Comment
Add comment · Show 4
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 AlwaysSunny · Jul 22, 2015 at 03:13 AM 0
Share

Hmm. Looks okay at a glance. Publishing.

avatar image Bunny83 · Jul 23, 2015 at 03:30 PM 0
Share

You have a strange viewport size. Are you suee you setup those the way you want? You should only see 1/5 of the screen at the bottom left corner. I guess it has something to do with your "Pixelator" script which probably renders the camera to a texture which is then viewed fullscreen. In that case the cameras don't really draw on top of each other.

I guess you use this one? We don't have the source code of that script so we can't say if it's the cause, but i guess it is ^^.

You would need to wait for all cameras to finish rendering before the script grabs the image.

avatar image Runalotski · Jul 23, 2015 at 03:41 PM 0
Share

https://youtu.be/NCtgbNP3AOA?t=1540

This video may help you it has the link is at the correct time for going straight into stopping the gun clipping walls

also dont be put off by the video length of an hour because the gun clipping is about 5 $$anonymous$$s form 25 $$anonymous$$s in

Edit

looking at your imgr picture your gun is a 2D sprite?

cant you just use the sprite Renderer component to order what is render last and there for on top

http://docs.unity3d.com/$$anonymous$$anual/class-SpriteRenderer.html

look at sorting layer and order in layer

avatar image KROEYF · Jul 23, 2015 at 03:49 PM 0
Share

@Bunny83 Yes, that is exactly the reason why it wasn't rendering. Thanks.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by KROEYF · Jul 23, 2015 at 05:54 PM

It seems as though my CameraPixelator class was not rendering my second layer.

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

6 People are following this question.

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

Related Questions

FPS gun clippes through walls 5 Answers

How to add gun to the model, as when it animate, the gun is dis-positioned. 2 Answers

Problem with camera 1 Answer

FPS Scripting Problems 2 Answers

Some issues with weapon switching and reloading? 2 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