playMaker

Author Topic: [Raycast] The raycast detect owner instead of other gameobject [SOLVED]  (Read 1607 times)

Sly

  • Full Member
  • ***
  • Posts: 124
Hello,

I've actually some problem to raycast, because it detect the owner instead of other gameobject.

I explain my situation:
My character is supposed to detect other character of the same class who collide with him. When the collision is detected with the action "collision event enter", I draw a raycast (with a repeat interval to 0, so it's not taking too much performance) to detect if the collider is in front.
I set a layer filter to "Enemy" but the problem is my owner has the same filter, and that's normal because it's the same class.

I don't know how to prevent this. :( Does someone have an idea why is doing this? Raycast should always ignore itself. And I don't know if it's because of the box collider.

I need your insight :)
« Last Edit: September 10, 2014, 08:41:13 AM by Sly »

Sly

  • Full Member
  • ***
  • Posts: 124
Re: [Raycast] The raycast detect owner instead of other gameobject
« Reply #1 on: September 10, 2014, 08:40:39 AM »
Ok I understand why the raycast was targeting the owner.
The box collider was not set to coordinate Y= 0 like the raycast was. So I don't know why but it make a conflict  :o
Now it's working well and the raycast is not detecting anymore the owner. I guess it's not a Playmaker issue but a unity issue.

Weird issue, but fixed and understand :)
I hope it will save time for some other people!

Have a nice day!