I have 2 Balls, 2 Nodes, and 1 Hand. I can pick up a ball, send it to a Node, grab it, put it on another Node, but I can't grab any other balls.
The problem is that the Ball is defined publicly in The Node Manager. The Node Manager is a script given to The Hand and Each Node, because these are the places The Ball needs to go. While each Holding Place can easily declare itself, there is only one spot for a Ball. I can't add two Balls. I could make a
Ball1 and a
Ball2, but that's not very scalable.
What I'd like to do is find a way to get the name of the Ball being looked at and use that to power the Ball Selection instead of using a public declaration.
What I want to do is something like a Raycast, but I feel like I'm already using a Raycast by using Pointer Enter and Pointer Exit. When you look at the Balls, they use the Pointers to activate certain scripts like changing the colors of the Balls, and actually triggering the code to grab things. If I can do all that with the Event Triggers, I should be able to specify a Ball. But I can't find out how to do that.
Part of me thinks the code for grabbing the Ball with your Hand actually needs to be on the Balls themselves, and not the Hand, but as much as I try, I can't seem to figure it out. I am officially giving in and asking for help.
I'm working off of this tutorial. I sent the author a message and he said that he's Working On It and would get back to me, but it's been like two weeks. It seems like it should be a really easy fix, but then again, the whole thing is spaghetti code, so who knows.