Hello,
I could use some math help with the following:
Given transform.position (a point in space), transform.forward (a direction in space), and a maximum distance I want to calculate a random point that is on a plane that passes through transform.position and is perpendicular to transform.forward. The random point should be up to a maximum distance away.
I know how to use Random.value. What I am looking for is the equation that comes back with an xyz point as noted above.
I am attaching a picture that hopefully illustrates/illuminates what I am looking for.
this should give you the general idea how at least i would approach this
http://answers.unity3d.com/questions/60252/placing-object-with-ray-cast.html
generally script attached to a invisible cube gravity off , cubes transforms locked from rotating … And fire the Ray when MouseOver() + Mouse Click. Then jump to some routine that does the random() Vector3 transforms around the invisible Cubes transform.position.
View the concept like it’s kinda like a drag Drop Manager
You could use the Vector3.Exclude method to exclude the plane normal from a Random.InUnitSphere, that should put all your randomized vectors on the plane.
Afterwards, you just multiply those vectors by whatever max size you want them to have.