|
Post by majestic on Oct 3, 2016 0:57:41 GMT
While in free directional mode, is there a way to check if my character is facing the camera?
|
|
|
Post by Invector on Oct 3, 2016 16:52:41 GMT
Jorge script a little example for you, basically you need to check the difference between both with a tolerence:
public bool InFaceOf(Transform other,float tolerance) { var fwd = new Vector3(other.forward.x, transform.forward.y, other.forward.z); return Vector3.Distance(-fwd, transform.forward) <= tolerance; }
|
|
|
Post by majestic on Oct 4, 2016 0:35:11 GMT
Great! Many thanks to you and Jorge, that's working really well. Stellar support once again.
|
|