Playmaker Forum

PlayMaker Feedback => Feature Requests => Topic started by: Dev_Sebas on April 10, 2012, 01:37:33 PM

Title: Layer Mask
Post by: Dev_Sebas on April 10, 2012, 01:37:33 PM
I know LayerMask isn´t available yet. But need need it.
I appreciate when it will be available.
Bye
Title: Re: Layer Mask
Post by: Alex Chouls on April 11, 2012, 11:47:29 AM
How do you want to use it? For a custom action? Or do you need a variable?

There's a workaround used in the Raycast action if you just need a UI in a custom action...
Title: Re: Layer Mask
Post by: Dev_Sebas on April 11, 2012, 03:46:08 PM
Hi Alex
I need it for create different holes (particle/simple textures) in my objects.
I need to know which layer ray cast have find. Something with the bools.
I´m I right?
Bye
Title: Re: Layer Mask
Post by: Dev_Sebas on April 15, 2012, 04:19:21 PM
Please Alex put this feature in the future.I think is very important.Please
Bye
Title: Re: Layer Mask
Post by: Alex Chouls on April 15, 2012, 04:37:19 PM
Actually I looked into this, and you should be able to get the GameObject layer with Get Property and then use an Int Switch to go to different states based on the layer.
Title: Re: Layer Mask
Post by: Dev_Sebas on April 15, 2012, 05:47:15 PM
Thanks for reply Alex
I´m gonna try to make it.
Bye
Title: Re: Layer Mask
Post by: Dev_Sebas on April 16, 2012, 06:19:20 PM
Now I have got this but it continues not working.
My gun shots and if ray cast find ant object it sends an event to go to Hit or Get Layer
I get the layer and it stores it on an integer. Next it will switch the result to another Materials (wood, water, concrete,ect) and it should go to the event.Which is an global transition.
My problem is the get property because I put my ground concrete and it doesn´t put number 1.
Please help me.
Title: Re: Layer Mask
Post by: Alex Chouls on April 16, 2012, 06:35:51 PM
The Target Object should be the GameObject hit by the Raycast.
Title: Re: Layer Mask
Post by: Dev_Sebas on April 16, 2012, 06:40:40 PM
Yes Alex but Get Property only accepts Objects, not GameObjects.
Title: Re: Layer Mask
Post by: Dev_Sebas on April 16, 2012, 06:55:19 PM
I have been trying too with Get Layer but it´s not working.
Title: Re: Layer Mask
Post by: Alex Chouls on April 16, 2012, 06:57:44 PM
Ahhh, I see. Actually I forgot that there is already a Get Layer action:
https://hutonggames.fogbugz.com/default.asp?W587

Use that instead of Get Property.

I'm working on some auto-casting so actions will be more flexible about object types... it can be a bit of a pain right now when you don't have the right object type...

EDIT: Posted at the same time! Will reply to Get Layer problems...
Title: Re: Layer Mask
Post by: Dev_Sebas on April 16, 2012, 07:11:10 PM
Alex please...you can forget things.You aren´t a robot,men. :D
Ok so I´m gonna try again with Get Layer.
Please understand my fail, I´m on Europe and this about 1 a.m. I need to go sleep.
Bye
See you later.
Title: Re: Layer Mask
Post by: Dev_Sebas on April 17, 2012, 06:23:52 PM
I have been playing with Get Layer and is everything good.
Thanks for your time Alex
Bye
Title: Re: Layer Mask
Post by: Alex Chouls on April 17, 2012, 07:40:14 PM
Great! I think Get Layer with an Int Switch is a good pattern that other people will find useful - good thread!
Title: Re: [SOLVED] Layer Mask
Post by: Dev_Sebas on April 18, 2012, 11:05:38 AM
Wait, wait it isn´t working at 100%.
Get Layer gives me an number and Int Switch compare that number to some values.
But Get Layer need to be every frame, if not won´t give me an number.
If is every frame the Int Switch won´t function because it´s the last action.
Thats the only problem.
I have tried to put Int Switch in another state but if every frame(I need this) is checked in Get Layer it won´t jump to the another state.
I need to make something like check if it picked the int.
Can you help? Please
I believe this can be an better thread.
Bye
Title: Re: Layer Mask
Post by: Dev_Sebas on April 18, 2012, 11:31:07 AM
SOLVED, solved, yes now is complete.
For put Int Switch working you just need to put in that state Get Layer and Wait action. Put Wait in something like 0.04 s.Because Get Laker needs time to calculate.
Next another state with Int Switch and with the same things for compare. The transition between the states is Finished.
And thats it.
Very nice
I appreciate much the time, Alex.
Bye
Title: Re: Layer Mask
Post by: pneill on May 22, 2012, 11:43:46 AM
Well, it's nice to see a pattern is available, but I think it's not very elegant.

So I'll cast another vote for LayerMask support.   That would be beautiful and make many a level designer happy. :)

Title: Re: Layer Mask
Post by: Roccinio on July 13, 2014, 12:55:57 PM
+1 here!
I am a newbie and i spend half a day trying to figure out how to do this.
Why not include in the linecast 2d command a drop down menu that lets us choose either the layer or the object for the linecast to interact with.
Thank you.
Title: Re: Layer Mask
Post by: Roccinio on July 13, 2014, 02:04:11 PM
I am sorry i just saw that there is a mask layer in the linecast but on the other hand your manual is empty for this action so it would be nice if you could please update it. :)
The more information we have the better!