playMaker

Author Topic: Game Object Compare Tag giving false positive  (Read 809 times)

Krauser1129

  • Playmaker Newbie
  • *
  • Posts: 22
Game Object Compare Tag giving false positive
« on: September 21, 2020, 02:57:13 PM »
I raycast forward and store the hit object as TargetOBJ.
I then use Game Object Compare Tag to the tag Enewmy. If true, go to next state.
There's nothing there but it keeps going to the next state like it picked up the enemy. I made a new object with the same stuff above but it doesn't pick up anything. I moved the turret like 100feet off the ground and it still keeps going to the next event. I redid the action and this specific turret still keeps giving off a false positive. I checked all the components, nothing is tagged as Enemy. Any ideas?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Game Object Compare Tag giving false positive
« Reply #1 on: September 21, 2020, 03:08:19 PM »
Hi.
Can you show an image of your action/state

Krauser1129

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Game Object Compare Tag giving false positive
« Reply #2 on: September 21, 2020, 03:13:07 PM »
I was able to sorta confirm there's not an enemy tag there so not sure what's going on.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Game Object Compare Tag giving false positive
« Reply #3 on: September 21, 2020, 03:51:15 PM »
Hi.
When you go back to the raycast state you probably need to clear the target object.
as the object will still be in the variable

But you should use layers on the raycast so it sees only the layer that you select (enemies/walls for example)

Krauser1129

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Game Object Compare Tag giving false positive
« Reply #4 on: September 21, 2020, 05:04:07 PM »
layer masks! You're a genius, thank you!!!