Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Changing a Ground texture in game

Discussion in 'World Building' started by JGWalt, Jun 9, 2018.

  1. JGWalt

    JGWalt

    Joined:
    Jun 9, 2018
    Posts:
    2
    Hey folks I am going to try my best to describe this. I am creating a 3D game where a character can buy upgrades such as roads and what not. I want the user to enter a top down view when they buy them and click where the road will go and it will then be placed. I want to basically add the road to the texture where they click and was wondering what is the best way to go about this? I do not want to add a mesh for the road unless I absolutely have to.
     
  2. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    I'm assuming your ground is a terrain.

    You want to set the splat maps on the terrain which you can do via the terrain api. It's your job to store the state for what you changed, as you will need to apply all changes when the game loads, it will not persist in builds. It does persist in the editor though which complicates testing even more.

    That's the basics of it, the details are somewhat more involved. Be prepared for a bit of a learning curve.
     
    JGWalt likes this.
  3. JGWalt

    JGWalt

    Joined:
    Jun 9, 2018
    Posts:
    2
    Thank you very much i really appreciate it.