Comments and answers for "Determining if my target is standing upright"
http://answers.unity.com/questions/36853/determining-if-my-target-is-standing-upright.html
The latest comments and answers for the question "Determining if my target is standing upright"Answer by diegodimap
http://answers.unity.com/answers/1397745/view.html
nice! it worked for me, I was using eulerAngle, but it do not work properly:
[1]: /storage/temp/100482-standing.pngWed, 23 Aug 2017 13:25:04 GMTdiegodimapAnswer by BigToe
http://answers.unity.com/answers/36912/view.html
<p>This is what I ended up using after Jesse reminded me of the transform.up vector.</p>
<pre><code>if (transform.up.y < .6f){
// code here
}
</code></pre>Mon, 06 Dec 2010 08:26:23 GMTBigToeComment by BigToe on BigToe's answer
http://answers.unity.com/comments/90090/view.html
Thanks. I completely forgot about the transform.up for some reason. i'll put my code below.Mon, 06 Dec 2010 08:25:50 GMTBigToeAnswer by Jesse Anders
http://answers.unity.com/answers/36877/view.html
<p>Don't use Euler angles for this. Instead, check the object's local 'up' vector to see how 'upright' it is. (An easy way to do this would be to compare the local up vector's 'y' value - assuming y is up - to some threshold value, e.g. .7. If you want to express the threshold in terms of an angle, you can compute the threshold for the y value from that angle using trig.)</p>Mon, 06 Dec 2010 02:51:14 GMTJesse AndersAnswer by BigToe
http://answers.unity.com/answers/36860/view.html
<p>Don't know if this is the correct way to do it, but it seems to work.</p>
<p>Basically look at the eular angles. If the angle is greater than 45, then I considered the target knocked down.</p>
<pre><code>if (360 - Mathf.Abs(transform.eulerAngles.x - 360) > 45 || 360 - Mathf.Abs(transform.eulerAngles.z - 360) > 45)
{
//The target is knocked over. Do what you please.
}
</code></pre>
<p>I'm guessing there may be a more elegant way.</p>Mon, 06 Dec 2010 00:23:21 GMTBigToe