Hello. I want to make character movement like this, where movement is restricted along a 2D pathway, where the pathway is not just a straight line. I know that this is fairly simple to do using iTween, but how can I make the path randomly generated (within some constraints, so that the path fits within the camera’s viewing) and have the path be visable to the player and not just inside Unity? Thanks
I don’t know how to do this myself (i’m sure it wouldn’t take more than a few hour to figure out) but you can get started here:
Okay, I looked into that. It uses dummy objects as the nodes for the path. How can I make an object move to a random point (within some constraints) after a condition happens?
Create a random vector3 using your constraint (i’ve used 0 - 100)
Vector3 targetPosition = new Vector3(Random.Range(0,100), Random.Range(0,100), Random.Range(0, 100));
Then move the object
transform.position.Translate(targetPosition);
Have you seen this yet: http://itween.pixelplacement.com/examples.php#randomPaths
im kinda a noob at unity code but i tried ur code,trooper can u tell me wats wrong?
I get this:
and when i click it i get this: