Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How to get Vector3.down in world space?

$
0
0
Hi, how can i get Vector.down in World Space? I have tried with -transform.up but it's still local. Here's my current code: Vector3 fwd = transform.TransformDirection(Vector3.down); RaycastHit hit; if(Physics.Raycast(transform.position, fwd, out hit, 10000, 1)) { if(hit.transform.name == "Landscape") { print(Vector3.Distance(transform.position, hit.point)); } } The problem is, that it's using local space. How can I send a raycast directly down in World Space? Thanks in advance. Andreas.

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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