- Home /
Mouse Drag an Object on a single axis
Mouse Drag an Object on a single axis such as x or y or z , so far i only have
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Update() {
Vector3 fwd = transform.TransformDirection(Vector3.forward);
if (Physics.Raycast(transform.position, fwd, 10))
print("There is something in front of the object!");
}
}
Comment