Gunrock Posted March 26, 2024 I have spent countless hours trying to produce a script in which the player enters a room and activates this shader. ACS: script "SetShader" (int shaderSetting) { //assuming that the player has a tid of 1000 SetUserVariable(1000, "shaderSetting", shaderSetting); } Zscript: class MyPlayerPawn : PlayerPawn { int shaderSetting; int shaderSettingLast; override void Tick() { Super.Tick(); if(shaderSetting != shaderSettingLast) { switch(shaderSetting) { case 0: Shader.SetEnabled(player,"ShaderA",false); Shader.SetEnabled(player,"ShaderB",false); break; case 1: Shader.SetEnabled(player,"ShaderA",true); Shader.SetEnabled(player,"ShaderB",false); break; case 2: Shader.SetEnabled(player,"ShaderA",false); Shader.SetEnabled(player,"ShaderB",true); break; } shaderSettingLast = shaderSetting; } } } I included a demo map that I have been struggling with this script for hours on. TestShader.zip 0 Quote Share this post Link to post
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.