how to make laser detect tag objects please Help
Very detailed question and thanks for the amount of information you provided. In order to detect an object using Raycast, go here:
So if you used this example:
using UnityEngine;
public class RaycastExample : MonoBehaviour
{
void FixedUpdate()
{
RaycastHit hit;
if (Physics.Raycast(transform.position, -Vector3.up, out hit))
print("Found an object - distance: " + hit.distance);
}
}
Then you will have to modify the origin (transform.position) and direction (-Vector3.up) to have it start from one position and then point in the direction you want it to. After that, you use ‘hit’ to obtain the information you need in order to do what you want. If you want to change the tag of an object then you’d use the ‘tag’ parameter after retrieving the collision object from ‘hit’.