Crazycarpet Posted May 2, 2017 Share Posted May 2, 2017 As the title states, is there a way to detect the path or name of the material the character controller is standing on in Leadwerks. Quote Link to comment Share on other sites More sharing options...
Genebris Posted May 2, 2017 Share Posted May 2, 2017 entity:GetMaterial() http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitygetmaterial-r127 http://www.leadwerks.com/werkspace/page/api-reference/_/surface/surfacegetmaterial-r212 Quote Link to comment Share on other sites More sharing options...
Einlander Posted May 3, 2017 Share Posted May 3, 2017 To go even further, you would need to WORLD PICK from the controllers feet to the ground. This will return a PICKINFO you would be able to get the exact surface. pickinfo.surface:GetMaterial() would get you the material itself. pickinfo.surface:GetMaterial():GetPath() should get the filename itself without going through extra steps. This will not work on terrains. Please click on the links. http://www.leadwerks.com/werkspace/page/api-reference/_/world/worldpick-r502 http://www.leadwerks.com/werkspace/page/api-reference/_/pickinfo/ http://www.leadwerks.com/werkspace/page/api-reference/_/surface/surfacegetmaterial-r212 http://www.leadwerks.com/werkspace/page/api-reference/_/asset/assetgetpath-r41 1 Quote Link to comment Share on other sites More sharing options...
Crazycarpet Posted May 3, 2017 Author Share Posted May 3, 2017 Thanks, didn't even think about using a pick operation. Quote Link to comment Share on other sites More sharing options...
Thirsty Panther Posted May 3, 2017 Share Posted May 3, 2017 This Monthly challenge covered this. http://www.leadwerks.com/werkspace/topic/15669-monthly-script-challenge/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.