Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class ClampMagNeg : MonoBehaviour
- {
- void Start()
- {
- Vector3 a = UnityEngine.Random.onUnitSphere;
- Debug.Log(a);
- float limit = a.magnitude * -0.5f;
- Debug.Log(limit);
- Vector3 b = Vector3.ClampMagnitude(a, limit);
- Debug.Log(b);
- Debug.Log(b.magnitude);
- Vector3 c = P5.Limit(a, limit);
- Debug.Log(c);
- Debug.Log(c.magnitude);
- }
- }
Add Comment
Please, Sign In to add comment