|
Ok so what I’d like to do is basically just create an object that is able to wander around on its own. Maybe I am going about this the wrong way, but so far here’s what I have. I want the object to randomly pick a degree in which it will rotate, and then randomly assign a distance for the object to travel. I was thinking i could tell the object to rotate, and them move it forward in the direction it turned to.
(comments are locked)
|
|
Add 'transform.Translate(transform.forward * speed * Time.deltaTime);' to your SpawnMove function. Any reason why you don't call your Generate() function in Update (or FixedUpdate/LateUpdate)?
(comments are locked)
|

And is this at all working?
You might want the params on Range to include .0 (as in 1.0) to get floating point values.
I see where this looks like it would rotate the thing every 5 seconds, but how do you want to move it?
Yes what I have right now works. It will rotate every 5 seconds, from there id like it to move forward in the direction its facing. Does that make sense? Whether it takes time to travel a given distance, or just moves there right away doesn't matter. Id prefer it move at a given speed though. Imagine a robot picking a direction and then moving forward in that direction, then repeating every 5 seconds. The user would have no control of where its traveling.