Hi,
I’ve placed a touch script to a plane with a mesh collider. It’s basically a raycasthit function to get feedback everytime the mouse clicks on the plane. It works but I just noticed that when I create another plane, there’s feedback to that plane as well even when I didn’t add the script to that object.
How do I make that script unique to only that one plane?
The idea I’m going for is create 2 planes with separate unique scripts. e.g “One plane with script to move horizontally and another plane with a script to move vertically”
Here’s a snippet:
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if (Input.GetMouseButtonDown (0)) //Returns true during the frame the user touches the object
{
if (Physics.Raycast (ray, hit, 100))
{
print("jump");
}
}
Thanks in advance.
-Hakimo