Hi I’m trying to write a script attached to an object so that in the web player, I can mouse click on something, and it has an action.
I haven’t seen it in the tutorials yet, closest is that you pass over something or step on something, but this is a FPS type interface and I want to click on things in the environment.
Hello guys, i used Andeeeee’s method and it works, but when the player clicks an object the only commands that work are the change level commands (Application.LoadScene()). Any other code i used does not work. Does anyone know why?
Its ok i fixed it. When i clicked the camera was casting a ray using ScreenPointToRay that converts 2d to 3d. When that ray hits an transform something happents. That “something” was not working… till now . I wanted to use an function in the object that the ray its with the classic method >
GameObject name;
name = GameObject.FindWithTag(“tagname”);
Finaly i fixed it with > transform.SendMessage(“func”);