playMaker

Author Topic: Set Camera Layer Cull Distance  (Read 4930 times)

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Set Camera Layer Cull Distance
« on: May 21, 2018, 02:24:22 PM »
Here's an action that does this: https://docs.unity3d.com/ScriptReference/Camera-layerCullDistances.html

In other words, you can set each layer to have it's own cull distance, instead of using the camera's far clipping plane. Can be useful for example if you want to not render small objects at a certain distance while still rendering larger ones, for optimization.
« Last Edit: May 22, 2018, 07:31:27 PM by terri »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Camera Layer Cull Distance
« Reply #1 on: May 22, 2018, 02:48:16 AM »
Hi,

 Cool thanks :)

 you should put them on the ecosystem, you are doing quite a lot of actions no?

 Bye,

 Jean

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Set Camera Layer Cull Distance
« Reply #2 on: May 22, 2018, 06:48:25 AM »
Hi, yes, I should! I always get sidetracked when I come around to learning how to do so though. Is there somewhere I can read up on the steps required?

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Set Camera Layer Cull Distance
« Reply #3 on: May 22, 2018, 03:54:13 PM »
Thanks! This is really great!
Tested and it works in Editor (2017.3), but not on build. Also the action seems to not finish, in editor I had to use NextFrameEvent or Wait to leave state.

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Set Camera Layer Cull Distance
« Reply #4 on: May 22, 2018, 06:22:12 PM »
Great! I missed it not working on builds, you're right. Not sure where to go from here to fix this though...

Finishing would be an easy fix, but kinda pointless if this doesn't work on builds.

If anyone has an insight it would be appreciated!

edit:
I also noticed that if you set the distance for another layer, it will first reset all the other ones... so there's that too.
« Last Edit: May 22, 2018, 06:31:27 PM by terri »

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Set Camera Layer Cull Distance
« Reply #5 on: May 22, 2018, 07:30:53 PM »
Ok, I think I got everything fixed! Action updated

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Camera Layer Cull Distance
« Reply #6 on: May 23, 2018, 01:57:00 AM »
Hi, yes, I should! I always get sidetracked when I come around to learning how to do so though. Is there somewhere I can read up on the steps required?

Cool :)

1: create a github account, and send me your github id, I'll give you access to the reps
2: download sourcetree or any git client application
3: clone from github the ecosystem repositories
4: open these repositories with Unity ( open them with the right version, when we get to that point, let me know)
5: add your actions in the repositories, and verify that unity doesn't throw errors
6: push your changes back to the online repositories and they will be on the ecoystem.

 Pm me with your email address, I'll help you during the process the first few times :)

Bye,

 Jean

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Set Camera Layer Cull Distance
« Reply #7 on: May 23, 2018, 08:03:08 AM »
Ok, I think I got everything fixed! Action updated
Thanks!