Quantcast
Channel: Questions in topic: "drawray"
Viewing all articles
Browse latest Browse all 92

Rotation with Raycasting

$
0
0

WHen I rotate my raycast doesn't rotate as well. why not?

  transform.Translate(Vector3.forward * Time.deltaTime * speed);
    //transform.Rotate(transform.right * Time.deltaTime * 5);
    Debug.DrawRay(transform.position, Vector3.forward * 10, Color.green);

    if (Physics.Raycast(transform.position, transform.forward, distance))
    {
        transform.Rotate(-transform.up * Time.deltaTime * 150);
        Debug.Log("ToClose");
    }

Viewing all articles
Browse latest Browse all 92

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>