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 LudwigVK · Nov 24, 2013 at 08:40 PM · performancespawnrange

¿can i draw Objects only when in a certain range around the Player?

hi there :b

You'll see... I have a level were you're walking thru a LOOOOONG Avenue full of Zombies & other physic objects like boxes, cars & stuff... it is at night so the player can't se anything beyond certain zone around him & zombies won't follow you until you can see them.... Problem is, there's a lot of stuff being draw, even if it's not visible yet. I don't really have performance troubles yet but anyways i wanna know if there's a way to only draw stuff like enemies & other objects when you get close to them.

  • was thinking about changing the clipping range of the camera but it also stop drawing buildings so it looks ugly (maybe could i apply the clipping range only to certain objects?) *also a friend of mine suggested me creating triggers to spawn objects while you're going thru the level, but as far as i have seen, this creates an awful little lag. *then i though about making spawners that creates zombies one by one, before you get close, but once the object is there, it still there & even if i could erase them, if the player goes back, the level would be empty...

Any ideas?

maybe i'm overthinking it too much & i'm just a beginner but i really wanna make it as flow & fast as i can

thanks you very much O:!

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

2 Replies

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

Answer by tanoshimi · Nov 24, 2013 at 09:09 PM

One approach would be to place your buildings on one layer and set the culling mask of a camera to render only that layer, using a far clipping plane. Then place all your other in-game objects (zombies, boxes, cars and stuff) on another layer and use a second camera to render that layer with a much closer clipping plane.

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 LudwigVK · Nov 25, 2013 at 11:57 PM 0
Share

good idea! thanks you a lot :b

avatar image
1

Answer by LudwigVK · Nov 26, 2013 at 07:01 PM

for anyone coming to this answer, i did what Tanoshimi suggested me; i used a Camera to render just the buildings & Skybox, then i used another to render other objects & put this as a child of the other camera. Problem then was that then i could see those objects even if they were behind buildings, i solved this by creating a script that when coming near to a certain range & therefore rendered, those objects were moved into the default layer so it was normally rendered, then when out of sight, they come back to the other 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

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

decrease draw call instantiated object 2 Answers

how to have object fall using random speed 0 Answers

Huge performance hit when spawning prefab with AI 1 Answer

Spawn single floor tile at mouse position 1 Answer

How To Random Range a Float? 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