Yue Posted April 10, 2019 Share Posted April 10, 2019 The idea is that when my character runs out of energy add a grayscale shader. In the editor I know how but I need through scripts. I appreciate an example, because what I have doesn't work for me. function Script:Start() local shader = Shader:Load("Shaders/PostProcess/grayscale.shader") self.entity:AddPostEffect(shader ) end Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted April 10, 2019 Solution Share Posted April 10, 2019 Cast the entity to a camera object to access that function: https://www8.cs.umu.se/kurser/TDBD12/VT04/lab/lua/tolua++.html See tolua.cast. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted April 11, 2019 Author Share Posted April 11, 2019 Ok, I already have it, however I don't know how to delete it, I have an option to delete all of them and not one specif Quote Link to comment Share on other sites More sharing options...
gamecreator Posted April 11, 2019 Share Posted April 11, 2019 I don't think you can remove individual shaders. You have to remove all of them and add back the ones you still want. Related to this, remember that you can add the same shader more than once so removing them by name would not make sense. I guess removing them by an index could work but it's not too bad to clear all and re-add. 1 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.