smoothRandomPosition

i have a question to all, who know and use this smoothrandomposition.js - script,
which is an example for the Perlin.cs-Script from the Plugin-Folder!

both i found in this forum…

in my example there is the following line:

transform.position = position + Vector3.Scale(SmoothRandom.GetVector3(speed), range);

range (for this example) is (1,1,1).
position of my gameObject is (0,0,0).
The PerlinNoise is working fantastic, but im not able to change the line above, to have the random-effect around the init-position (here: 0,0,0)
I mean in a range of -1 to 1 and not 0 to 1.

the effect is: starting this smoothPosition, the object doesnt ‘dance’ around (0,0,0). The center of the Perlin-Effect is for example (0.3,0.3,0.3)…

can someone help me?
thanx a lot!!!

The range -1 to 1 is of size 2, so your range needs to be (2,2,2) instead. That’ll give you positions between (0,0,0) and (2,2,2), so you’ll want to offset by (-1,-1,-1) to re-center on the origin.

thank you laurie, that was the working hint!!!

for everybody who use the smoothRandomPosition-Script and has the same issue:

var range = Vector3 (2.0, 2.0, 2.0);  //change it like lauries description
.
.
transform.position = Vector3.Scale(SmoothRandom.GetVector3(speed), range) + Vector3 (-1,-1,-1); //change it like lauries description

PerlinNoise is wonderful :wink: