- Home /
Placing a road
Hey there everyone, I'm stuck once again.
I'm trying to place a road. I have a prefab, which is just a plane. I want to instantiate the prefab over and over again from the position the player places it to where the cursor is (without rotating). So basically:
1) left click and place the beginning of the road(got this already)
2) left click again to place the end of the road
I already have the system to place objects, I just need some help in the right direction.
This is the code I'm using to place objects after each other, it's working perfectly, except for the fact that it's not stopping at a certain point: Instance = Instantiate(InstancePrefab, Instance.transform.position + Instance.transform.forward * 10, Instance.transform.rotation) as GameObject;
Any help is appreciated!