Guest User

Untitled

a guest
Jan 18th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class ClampMagNeg : MonoBehaviour
  4. {
  5. void Start()
  6. {
  7. Vector3 a = UnityEngine.Random.onUnitSphere;
  8. Debug.Log(a);
  9. float limit = a.magnitude * -0.5f;
  10. Debug.Log(limit);
  11.  
  12. Vector3 b = Vector3.ClampMagnitude(a, limit);
  13. Debug.Log(b);
  14. Debug.Log(b.magnitude);
  15.  
  16. Vector3 c = P5.Limit(a, limit);
  17. Debug.Log(c);
  18. Debug.Log(c.magnitude);
  19. }
  20. }
Add Comment
Please, Sign In to add comment