playMaker

Author Topic: Raycast problem  (Read 2281 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Raycast problem
« 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.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Raycast problem
« Reply #1 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?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: Raycast problem
« Reply #2 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.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Raycast problem
« Reply #3 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.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: Raycast problem
« Reply #4 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.