Kizspy | Question: 21
(Choose 1 answer)
What does this script do?
using UnityEngine;
public class TouchRaycast: MonoBehaviour {
void Update() {
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase. Began) {
Ray ray = Camera.main.ScreenPointToRay (Input.GetTouch(0));
if (Physics. Raycast(ray)) {
Debug.Log("Hit something!");
A. Detects initial touch input and logs raycast hits on scene objects
B. Relocates the GameObject based on touch position coordinates
C. Alters the GameObject's color upon touch detection
D. Initiates an animation sequence on touch interaction