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

Mathf.Approximately not working.

$
0
0
I'm trying to make a projectile travel straight up to an X-coordinate. Upon reaching the X-coordinate, I want it to start moving up on the Y-axis.
The problem is that upon reaching the X-coordinate, it stops and doesn't move up on the Y-axis.

Code (CSharp):
  1.  
  2. public class Earthspike : Projectile
  3. {
  4.         Vector2 newTargetPos {
  5.                 get {
  6.                         return Mathf.Approximately (Mathf.Abs (transform.position.x - targetPos.x)) == 0 ? new Vector2 (transform.position.x,...
Mathf.Approximately not working.

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



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