I just got some new assets from my design partner. I worked the numbers and everything is in place as it was before, except I put the spawning of the triangles in its’ own script instead of having it in the board script.
Before I had some movement of pawns. Now there is nothing. Even testing to see if I click on a triangle, nothing happens. I should also note that the triangles are located underneath the board, so they don’t interfere with pawn movement. I know there is a rigidbody attached to the triangle, pawns were moving without that component before. I was just trying things.
I’ll show some code I am using to test to see if I am clicking on a triangle. I will also include some pictures showing that my triangles have mesh colliders, and the inspector info of the board and triangle.
The ray is hitting the board, but not the triangles.
There is a mesh attached to the ‘Mesh’ property of the Mesh Collider.
Thanks for the programming tip.
I am starting to think that the new triangle model is the problem. The previous triangle model I had worked, but the mesh was messed up. This caused non-precise mouse clicking and pawn movement. I asked for a new triangle, and this is what happened.
Try turning the board collider off. Maybe for some stupid reason the board collider encompasses the triangles’? It’s not a solution, just to help diagnose the underlying issue.
I don’t have enough experience with such things to suggest anything else short of uploading your project for us to check out. Though, I’m sure someone else here has better input than me.
Yeah, it does stop when it hits a collider. But I don’t know too much to work around this. I think there’s a way to limit the raycast to a specific layer, but I don’t know more beyond that.
My only other thought is to make sure that the board’s collider doesn’t intersect the triangle’s.