Jump to content

No Footstep Sounds on Terrain with GTS Applied

Go to solution Solved by mkikuchi53,

Recommended Posts

Hello. I'm currently working on using an asset called 'Footstepper' to play footsteps based on textures generated with GTS on a terrain. This asset recognizes the texture of the terrain at the position where a raycast collides and can play a pre-set sound. When running in the editor, I can successfully produce the sound. However, after building the game, there is no sound.

Upon investigation, I've discovered that the Terrain Layers of the TerrainData are disappearing after the build. Terrain Layers are necessary to produce sound. How can I ensure that Terrain Layers are present in the game after building?

I tried adding a Terrain Layer file during runtime using the Layer, but it resulted in only one sound being played, or a black texture being generated, and it didn't work as expected.

Link to comment
Share on other sites

As a temporary solution, after applying the Profile in GTS Manager, pressing 'Remove Profile' and putting it in the 'Profile not active in Scene' state allowed me to play footsteps while maintaining a beautiful appearance. It's also possible to execute 'Apply Profile' again from the script, but it doesn't seem necessary since the visual aspect is not affected.

Link to comment
Share on other sites

You are accurate in your assumption that the Terrain Layers are intentionally omitted from the build within the GTS framework. This exclusion is by design, as we do not leverage the Terrain Layers subsequent to executing the 'Apply Profile' operation. The rationale behind this approach is that a duplicate of the Terrain Layers is created and transferred to the 'GTS Terrain Layer,' which is then utilized for visual representation.

We do not plan on adding this in the future. 


Link to comment
Share on other sites

  • 2 weeks later...
  • Solution

Thank you for your response. I apologize for not checking the topic for a while. I now understand the specifications of GTS.

I had a misunderstanding, and the method of executing 'Apply Profile' during runtime didn't apply GTS successfully. This was because the GTS Terrain component's Profile and gtsTerrainMaterial were null. I tried forcibly setting these two from the script and attempted to apply GTS, but the terrain stopped displaying and it didn't work well. As another attempt, I tried to retrieve the alphamap from the Control0 texture, but I gave up as I couldn't understand the specification of GetAlphamaps().

In the end, I was able to coexist GTS with 'Footstepper' using the following method:

1. In the editor, I obtained the entire alphamaps with GetAlphamaps() and backed it up to a file.

2. I confirmed that the terrain layer count was 0, then added and restored the terrain layers from the file.

3. I loaded the alphamaps file from StreamingAssets.

4. I executed SetAlphamaps() to restore the entire alphamaps.

I'm glad I didn't give up on using GTS.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

  • Create New...