Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

C# - Find Y coordinate given X value and slope (in degrees)

$
0
0
Hello,

First time poster, pretty stumped right now as to how to do this because the way I've been told to do so does not work 100% of the times. Basically, I'm trying to create a random tree generator. This tree generator works, except that if I rotate the "Earth" (For now it's only being rotated on the X axis), the trees still spawn with a Y coordinate of:

Code (CSharp):
  1. treePrefab.transform.localScale.y/2
(Above code works fine)

But if I take the "Earth", and rotate it 45 degrees,...

C# - Find Y coordinate given X value and slope (in degrees)

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



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