I’ve tried a few different ways and looked at about 12 articles/tutorials but I can’t find out what’ wrong. public class MovingTapBox : MonoBehaviour {
Vector3 MousePos;
public int TapDamage = 10;
void MovingClickBox()
{
if (Input.GetMouseButtonDown(0) == true)
{
MousePos = Input.mousePosition;
gameObject.transform.position = MousePos;
}
}
I’m trying to make the game object move according to the position of the mouse when they click.