playMaker

Author Topic: Layer Mask  (Read 6910 times)

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Layer Mask
« on: April 10, 2012, 10:37:33 AM »
I know LayerMask isn´t available yet. But need need it.
I appreciate when it will be available.
Bye
« Last Edit: April 18, 2012, 08:06:37 AM by Sebastiao »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3570
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Layer Mask
« Reply #1 on: April 11, 2012, 08: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...

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: Layer Mask
« Reply #2 on: April 11, 2012, 12: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

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: Layer Mask
« Reply #3 on: April 15, 2012, 01:19:21 PM »
Please Alex put this feature in the future.I think is very important.Please
Bye

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3570
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Layer Mask
« Reply #4 on: April 15, 2012, 01: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.

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: Layer Mask
« Reply #5 on: April 15, 2012, 02:47:15 PM »
Thanks for reply Alex
I´m gonna try to make it.
Bye

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: Layer Mask
« Reply #6 on: April 16, 2012, 03: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.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3570
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Layer Mask
« Reply #7 on: April 16, 2012, 03:35:51 PM »
The Target Object should be the GameObject hit by the Raycast.

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: Layer Mask
« Reply #8 on: April 16, 2012, 03:40:40 PM »
Yes Alex but Get Property only accepts Objects, not GameObjects.

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: Layer Mask
« Reply #9 on: April 16, 2012, 03:55:19 PM »
I have been trying too with Get Layer but it´s not working.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3570
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Layer Mask
« Reply #10 on: April 16, 2012, 03: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...
« Last Edit: April 16, 2012, 04:00:55 PM by Alex Chouls »

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: Layer Mask
« Reply #11 on: April 16, 2012, 04: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.

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: Layer Mask
« Reply #12 on: April 17, 2012, 03:23:52 PM »
I have been playing with Get Layer and is everything good.
Thanks for your time Alex
Bye

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3570
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Layer Mask
« Reply #13 on: April 17, 2012, 04:40:14 PM »
Great! I think Get Layer with an Int Switch is a good pattern that other people will find useful - good thread!

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • View Profile
    • Blog
Re: [SOLVED] Layer Mask
« Reply #14 on: April 18, 2012, 08: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