- Home /
Turn Mesh Render On In Another Script?
I made a weapon pickup script, so far I got the character to press the F key and the object disappears. Both of the objects are prefabs and I have disabled the Mesh Render on the other sword.
How do I make the mesh renderer activate once the player presses the F button.
Answer by DaveA · Oct 23, 2012 at 05:50 PM
other.renderer.enabled = true; // I suppose. Hard to tell from your description what's what
Please try to avoid using names like 'object' for variables, they are too close to reserved words like Object and can easily confuse.
Answer by Subzero619 · Oct 23, 2012 at 08:04 PM
Thanks so much :) after making a variable at the top it worked.
If anyone else has this problem heres my fix.
At the top make a variable
var other = GameObject.Find("Sword");
then under function update put the answer by Dave.
Thanks alot Dave :)
Your answer
Follow this Question
Related Questions
Platform moves when character steps on it 1 Answer
Timer activates script 1 Answer
Saving an object from script to project? 0 Answers
How do I set a maximum distance on an activate-able object? 1 Answer
Hide/Show a game object and activate/deactivate a script of another game object with one script 1 Answer