Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: nick_h82 on September 28, 2015, 04:30:04 AM

Title: Set Light Culling Mask
Post by: nick_h82 on September 28, 2015, 04:30:04 AM
As per the title, I need to set the culling mask of a light. I tried copying what the camera culling mask action did, as that works in the way I'd like, but got an error:

Assets/PlayMaker Custom Actions/SetLightCullingMask.cs(52,22): error CS0120: An object reference is required to access non-static member `UnityEngine.Light.cullingMask'

I've attached my attempt below. Really need to learn some rudimentary C# sometime..
Title: Re: Set Light Culling Mask
Post by: nick_h82 on October 01, 2015, 01:48:13 AM
I should add I looked at the wiki for writing actions, the ActionHelpers class page is TODO since 2011..
Title: Re: Set Light Culling Mask
Post by: dudebxl on October 01, 2015, 07:13:52 AM
Hi,

Have u tried ' set sorting renderer layer ' ?

U can get from ecosystem... If it does not work, then let me know and i make it for u..

Title: Re: Set Light Culling Mask
Post by: nick_h82 on October 01, 2015, 10:08:32 PM
Hi Dudebxl,

Thanks for the suggestion. I tried that but it wasn't quite what I was after. Effectively I was trying for an action that works exactly like SetCameraCullingMask does, in terms of setting layers, just on the light rather than the camera. I'd be very grateful for any help, even if it's just advice on where I'm going wrong with the earlier script.
Title: Re: Set Light Culling Mask
Post by: dudebxl on October 02, 2015, 04:15:46 AM
done.

on ecosystem or here: https://snipt.net/dudebxl/setlightcullingmask/

not sure what you did wrong but i took the camera culling script and modified it in 1 min. Check ur script vs my script to find ur mistake.

good luck  ;D
Title: Re: Set Light Culling Mask
Post by: nick_h82 on October 03, 2015, 04:40:18 AM
Hi, yup, incorrect capitalisation on my part, otherwise we had the same solution. Thanks for helping out!