Quantcast
Channel: Questions in topic: "transform.transformpoint"
Viewing all articles
Browse latest Browse all 29

Elegantly flattening a relative vector

$
0
0
Vector3 zed = other.transform.InverseTransformVector (transform.position - other.transform.position); zed .x = 0f; zed .y = 0f; zed = other.transform.position + other.transform.TransformVector (zed); I'm using this for grind physics. This takes my player's position relative to a waypoint, converts it to the waypoint's local space, removes X and Y then converts it back to world space to get the player's position between waypoints I'd like to know if there's a way to do that that's not quite so hilariously messy and expensive.

Viewing all articles
Browse latest Browse all 29

Trending Articles



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