- Home /
Question by
betaFlux · Sep 06, 2014 at 03:50 PM ·
worldspacelocalpositionlocalrotationlocalspace
Random.insideUnitSphere doesn't work as expected
Does anyone know why this snippet returns a position around world space zero? (the transform is a child)
float radius = 5;
float zDistance = 5;
targetPosition = new Vector3(Random.insideUnitSphere.x * radius,
Random.insideUnitSphere.y * radius,
zDistance)
+ transform.position;
Comment
Your answer
Follow this Question
Related Questions
How can I get an OverlapBox with the exact same size and position as a BoxCollider? 1 Answer
Can I use the local x,y transforms of a plane? 1 Answer
Class member Vector3 based on local transform 1 Answer
rigidbody.MoveRotation neither world space or local? How does it work? 1 Answer
Weapon ("Snapping") Socketing FPS 1 Answer