Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on February 06, 2015, 02:52:36 PM

Title: Raycast problem
Post by: Rabagast on February 06, 2015, 02:52:36 PM
Hi!

I don't understand what is wrong here?

This is just an example explanation:

I want cube A collide with cube B.
On cube A, I have a Raycast and Rigidbody.
I have these actions:
Raycast with this setup:
-Direction = Y -1
-Space  = Self
-Distance = 1
-Store Hit Object = Cube B

Game Object Compare Tag:
Game Object = Cube B
Tag = Wall
True Event = Collide

Cube B has the tag Wall.

Do you think this works? NO!
It should work. I can't see anything wrong here.

Can someone explain me the use of Raycast with Game Object Compare Tag? It works if I set it to false. Or if I use Store Did Hit, and use a specific layer.
But not Game Object Compare Tag - True Event.
Title: Re: Raycast problem
Post by: Rabagast on February 06, 2015, 03:02:08 PM
It works if I Check Every Frame on Game Object Compare Tag.
Why do I need to check Every Frame in this case?
Title: Re: Raycast problem
Post by: cloud03 on February 07, 2015, 09:55:57 PM
Well are the raycast and the game object tag compare in the same state? if it is, then game compare object tag every frame option should be checked.

The way I'd do it is by sending to a next state when the raycast hit the object, and compare the tag on that next state.
Title: Re: Raycast problem
Post by: Rabagast on February 09, 2015, 02:29:21 PM
Hi!

They are on the same state. All the examples I have watched also do the same.
Title: Re: Raycast problem
Post by: cloud03 on February 10, 2015, 08:15:35 PM
Well in that case, the Game Object Compare Tag "Every frame" option should be checked. If it isn't, as soon when the gameplay start, and the action could not find the game object to be compared with, it will be disabled right away.

With every frame, the Compare action will check everyframe, and when the raycast hit an object and stored it, the compare action will check that object tag right away.