Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class test : MonoBehaviour {
- RaycastHit hitFire;
- Ray rayFire = Camera.main.ScreenPointToRay (Input.mousePosition);
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- AimAndFire();
- }
- void AimAndFire(){
- if (Input.GetMouseButtonDown (0)){
- if (Physics.Raycast (rayFire, ref hitFire)) {
- //var fireDirection = (hitFire.point - transform.position);
- //fireDirection.y = 0;
- //var rotation = Quaternion.LookRotation(fireDirection);
- //transform.rotation = rotation;
- Debug.Log("Hit!: " + hitFire.point);
- GameObject.Find("Sphere").GetComponent(SteerForPoint).TargetPoint = hitFire.point;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement