Use raycasting to see if two identical tokens are in a row

How do I…

I was wondering if I could use ray casting to cast a ray from one piece on a board directly right and see if it impacts another piece - i.e. two in a row.

What is the actual result

Explain what is happening instead, what is going wrong. - no idea it seems the ray isn’t connecting / being cast given no output can be receive - it looks like it should work, but it isn’t!

any help / advice would be greatly appreciated

Screen Shot 2024-07-27 at 4.59.43 pm

Related screenshots

Please include a screenshot of the full related events including both conditions and actions.
And screenshots to help showing us the issue.

Project files (optional)

Insert a minimal game showing your issue in a .zip or .rar.

Your events look OK. Where are the x, y of the hit object. If it’s higher than the player object (purple) it might miss the player object.

You’ll probably want it to the right of the object (green) so it doesn’t detect the object that’s on it.

You may need a pick all instances before you do the raycast (though I’m not 100% sure).The raycast may only be working with the one player from the grandparent event.

And raycast from circle.CenterX() + Player.Width(), so you’re not raycasting from the within the player as Keith_1357 suggest.