playMaker

Author Topic: Raycast function / Ignore raycast Layer [SOLVED]  (Read 3824 times)

agito1987

  • Playmaker Newbie
  • *
  • Posts: 37
Raycast function / Ignore raycast Layer [SOLVED]
« on: September 26, 2017, 09:10:41 AM »
Hey

I am using the Raycast function to determine where my player shoots and spawns colliders at the received hit position.

The description says that the mask function does not work yet and that you should use the ignore raycast layer.

Player being able to hit the colliders he shot was never a problem because they only stay in game for 0.1 seconds.
However now that I am adding enemy bullets that fly slowly at the player. The raycast of the player hits the projectiles even though they are on the ignore raycast layer.

Would be great if someone could tell me how I can fix this.

(Don’t know if its important but the projectiles have a sphere collider checked is trigger, and a rigid body)
« Last Edit: September 27, 2017, 10:38:42 AM by agito1987 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Raycast function / Ignore raycast Layer
« Reply #1 on: September 26, 2017, 11:33:18 AM »
Hi.
Do you mean raycast actions?

Where did you get that description? i can't seem to find it.

Layer mask on the raycast actions should work.

The layers you add will be looked for, not ignored unless you check 'invert mask'
then the list will be ignored and everything else not.

agito1987

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Raycast function / Ignore raycast Layer
« Reply #2 on: September 26, 2017, 12:44:16 PM »
I found the description when clicking on the question mark within unity

https://hutonggames.fogbugz.com/default.asp?W492

Lol it’s an old description I guess XD
How do I set this array up for the masking?
It says int array. But how do I setup an array for my layers?

And damn, you help me out a lot on this sit. it’s like… you live here XD

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Raycast function / Ignore raycast Layer
« Reply #3 on: September 26, 2017, 01:14:37 PM »
Hi,
i think so, many parts need to be updated there :)

it is an array used inside the action and the info is indeed confusing.
It should say something like : set the ammount of layers you wish to check.
or something similar.

On 'Layer Mask  set the number of layer you want to check (you can change later if you need more or less) and press enter

Then below it there will be Elements, click on them and set the layers you want to detect.

If you want to ignore layers instead of Detecting them then you need to check invert mask.

agito1987

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Raycast function / Ignore raycast Layer [SOLVED]
« Reply #4 on: September 27, 2017, 10:42:14 AM »
Ok that makes everything clear!

Once again thank you for the help.  ;D

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Raycast function / Ignore raycast Layer [SOLVED]
« Reply #5 on: September 27, 2017, 11:08:47 AM »
Hi,
Happy to help :)