playMaker

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

terri

  • Sr. Member
  • ****
  • Posts: 371
    • View Profile
    • terrivellmann.tumblr.com
Set Camera Layer Cull Distance
« on: May 21, 2018, 11:24:22 AM »
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, 04:31:27 PM by terri »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13323
  • Official Playmaker Support
    • View Profile
Re: Set Camera Layer Cull Distance
« Reply #1 on: May 21, 2018, 11:48:16 PM »
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: 371
    • View Profile
    • terrivellmann.tumblr.com
Re: Set Camera Layer Cull Distance
« Reply #2 on: May 22, 2018, 03: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: 579
    • View Profile
    • Car and Traffic Playmaker assets
Re: Set Camera Layer Cull Distance
« Reply #3 on: May 22, 2018, 12: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: 371
    • View Profile
    • terrivellmann.tumblr.com
Re: Set Camera Layer Cull Distance
« Reply #4 on: May 22, 2018, 03: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, 03:31:27 PM by terri »

terri

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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13323
  • Official Playmaker Support
    • View Profile
Re: Set Camera Layer Cull Distance
« Reply #6 on: May 22, 2018, 10:57:00 PM »
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: 579
    • View Profile
    • Car and Traffic Playmaker assets
Re: Set Camera Layer Cull Distance
« Reply #7 on: May 23, 2018, 05:03:08 AM »
Ok, I think I got everything fixed! Action updated
Thanks!