I’m having a possibly basic problem.
I an object that for my game there will be multiple, but when I select one they all do their functions. I tried doing a list in the script but that didn’t work so I changed it back to how i first did it.
I first just wanted the function to work
if (Selected==true)
{
if (Input.GetMouseButtonDown(0))
{
Vector3 mousePosition = Input.mousePosition;
Ray ray = m_Camera.ScreenPointToRay(mousePosition);
if (Physics.Raycast(ray, out RaycastHit hit))
{
//move
}
}
}
then I tried a list thats gets added too every time a new object is added but that didn’t work