- Home /
Need help with showing slender static?
Hi, I am trying to make a Slender game, and I have this script to show static on the screen when you look at the Slenderman for too long, but when it displays it, it only shows it on the lower half of the screen and if I look up and down, I cannot see it. Here is what I mean:
Here is the script for the static:
// script has now been removed
Any ideas? Any help is appreciated. Thanks!
The script has now been removed. To future readers, follow the instructions as given by sparkzbarca and No1Survivalist :
Use a plane. Position and scale it to cover the front of the camera
remove the collider
add your material
give the material a shader that uses the alpha of the color in the material (eg a transparent shader, a shader with transparency)
adjust the alpha through script
wham bam, done and done =]
.
var newAlpha : float = 1.0 - (health / startingHealth);
renderer.material.color.a = newAlpha;
alucardj
How did you get the static, did u get the sound 2, if so were.... I need both
Yeah I also got this script but didn't work, error... Idk y, ideas anyone????
New Forum Thread. This is now the only place I shall write answers to problems with my scripts : http://forum.unity3d.com/threads/172415-Slender-Guide-by-alucardj
Answer by AlucardJay · Nov 21, 2012 at 04:14 AM
This is my script. It creates a mesh that extends to the full view fustrum. Basically it displays an image for the whole screen, and the alpha can be controlled. To make it work, you must make the script object a child of the camera ... simple.
As I said where you saw this script, for all questions regarding the guide, ask on the question I posted the guide
I also bet you never upvoted my answer where you found this :/
Just to say I have now removed the packages for my guide. Reasons : no thanks except from 2 people total and 5 votes over 2 answers; when specifically stating don't ask new questions but post problems on those questions, there have been at least 20 questions all using my scripts, all by people that don't understand and just want their game written for them;
I am extremely disappointed. and sorry for the few people that actually read the guide, absorbed the script and learned from it, then expanded my guide into their own projects rather than copy-paste this doesn't work . Hope you feel lucky to be the last one with the packages. I bet I get more comments asking me to put them back up than comments saying thanks.
TO future readers who are lucky enough to stumble across this, the answer to this question has already been given in a comment by me (AlucardJ) to Peanut97 in the comments where all questions related to this guide should be posted : http://answers.unity3d.com/questions/296068/how-to-make-a-slender-man-follow-character-script.html
$$anonymous$$y comment :
Yeah I wrote that script for this, but it pretty cool so might use it for other full-screen effects (blood splats, rain). I asked a question on how to use an unlit shader (so the whole effect is bright, not just where the flashlight hits it), the answer and shader can be found here : http://answers.unity3d.com/questions/345917/correct-unlit-shader-to-use-when-fading-a-material.html Edit : the shader is now in the V2 package =]
Now to your question. The static should be working already, just look at the $$anonymous$$an.
EDIT : I just realized I left some code in that script from testing that shouldn't be there! In the Update, delete if(Input.Get$$anonymous$$ouseButtonDown() and everything in {}, just leave SetAlpha(); and ScrollUVs(); (I have just fixed the script in the package for future people, sorry!)
If you want to use the script for your self, follow these steps.
create a new script, copy everything from static into it.
now in the new script, delete var theEnemy : EnemyScript;
in function Start, delete everything except Startup();
in function SetAlpha() , delete the line theAlpha = ( 100.0 - theEnemy.health ) * 0.01;
in a new scene, create an empty gameObject, attach the new edited static script, and then make the gameObject the child of the camera (you need to do this so the effect follows the camera and is always seen as full-screen.
Add a material to the empty gameObject.
When you hit play, the mesh wont be visible. In the inspector, change the value for theAlpha to between 0 and 1 (while the scene is playing. You should see the material being faded in and out.
Here are some links I strongly suggest to all new users :
Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/essential-skills/
Start at the bottom and work up : http://www.unity3dstudent.com/category/modules/beginner/
this is the YouTube link for the above as one playlist : http://www.youtube.com/watch?v=-oXYHNSmTxg&list=PL27B696FB515608D2&feature=plcp
Character controller and terrain : http://cgcookie.com/unity/2011/12/05/introduction-to-character-controllers/
That is good to get started. Then start with a small tutorial, this is a simple 2D space shooter : http://www.unityjumpstart.com/ProofOfConcept_1/ : click on the videos part1.mp4 part2,3,4 =]
I just found another by our own Eric : http://wiki.unity3d.com/index.php?title=2DShooter : http://forum.unity3d.com/threads/7883-2D-shooter-tutorial
By then you should be getting the hang of things and starting to have ideas of your own. When you decide what kind of game you want to make, then look at each part you'll need. For example, if you want to make some terrain then walk around it with a character : http://cgcookie.com/unity/2011/12/05/introduction-to-character-controllers/
Here's another on the same 'site but I havn't checked the difficulty : http://cgcookie.com/unity/2012/02/24/game-planning-lunar-lander-01/
Basically then just search for tutorials, there are many out there, either written or on youtube.
the Unity Wiki tutorials : http://wiki.unity3d.com/index.php/Tutorials
A big list of tutorials : http://answers.unity3d.com/questions/12321/how-can-i-start-learning-unity-fast-list-of-tutori.html
Helpful page with information on using Built-In Arrays and Lists (you'll need this later!) : http://www.unifycommunity.com/wiki/index.php?title=Which_$$anonymous$$ind_Of_Array_Or_Collection_Should_I_Use?
The unity wiki link above is very handy with lots of scripts and shaders too (just check out all the links down the left, and the tabs along the top : http://wiki.unity3d.com/index.php/Scripts )
http://answers.unity3d.com/questions/148211/list-of-frequently-asked-beginners-questions.html
http://forum.unity3d.com/threads/132628-How-to-help-the-Absolute-Beginner
If you know what kind of game you want to make, edit your question and write there what you are thinking of, then there may be a tutorial out there for that!
But just be aware, you will do lots of typing, deleting, typing, bashing head on desk, being really happy when it works and you understand how and why. I hope this helps, Happy Coding =]
Answer by sparkzbarca · Nov 21, 2012 at 04:06 AM
too complicated :P
much easier way to do this.
attach the static image to the camera (make it a child) in the scene so it completely shows up in front of the camera at all times.
Now enable and disable this object depending on whether you can see slenderman.
mark as answered :)
by using my code, hes right. Its really not complicated. $$anonymous$$inda simplest way of doing it... hits collider hits collider, enables gui texture..
Absolutely. I'm even going to upvote both your answers! It's funny, this is the technique I have fallen back to when I demonstrated it in my new video series. I was proud of my script for its technical ability, but really it is dangerous in the wrong hands.
Use a plane. Position and scale it to cover the front of the camera
remove the collider
add your material
give it a shader that uses the alpha of the color in the material (eg a transparent shader, a shader with transparency)
adjust the alpha through script
wham bam, done and done =]
.
var newAlpha : float = 1.0 - (health / startingHealth);
renderer.material.color.a = newAlpha;
Answer by corriedotdev · Mar 24, 2013 at 02:14 PM
Ok so i think this is probably the best way to do it personally. On your fps controller make a collider, a cube will do. Extend this out about 15 meters from you fps character. Make the mesh invisible. Then attach it as a child of the camera so it moves where you look. Add the script below to a cube collider which is around slender, again make it invisible and a child of slender. Attach the cotect gameobjects in the inspector menu to the script.
Now you need a gui texture. So get some static put it on phtotshop and turn opacity down a little bit so you can see throug hit a little, allowing you to see slender. This is the guitexture you want to use in the script.
So basically this is the idea
Collider on fps controller hits the collider on slender
plays the gui texture // for how many seconds, change in code
If you want sound attach a audio source to the collider on slender and the following script. SO this sound will play when they collide. i.e your looking at slender
Static image
also disable the gui texture and on the fps walker in inspector tag player
var Static : GUITexture;
function OnTriggerEnter(hit : Collider){
if(hit.gameObject.tag == "Player")
{
YourTexture.enabled = true;
yield WaitForSeconds(0.5);
YourTexture.enabled = false;
}
}
Sound script
make sound static sound in inspector remember to attach audio source to the collider
var Sound : AudioClip;
function OnTriggerEnter(){
audio.PlayOneShot(Sound);
}
If you get stuck ill try help but its pretty self explanatory if you have some basic unity skills
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How could I create a book? 6 Answers
I made a better shader how do i fix[add _Shadow Strength]help???>Sorry that im asking for to much 1 Answer
Help with Slender Pick Up Pages Script? 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers