Search Unity

Slender Guide by alucardj

Discussion in 'Scripting' started by AlucardJay, Mar 2, 2013.

Thread Status:
Not open for further replies.
  1. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Finally I have given up and am now making my scripts available for download. If you need to know how these scripts work, watch all my videos. If you want to just get the game running, follow the videos starting at 79 _ Slender the Examination

    N̶o̶w̶ ̶f̶o̶r̶ ̶t̶h̶e̶ ̶l̶i̶n̶k̶ ̶t̶o̶ ̶t̶h̶e̶ ̶s̶c̶r̶i̶p̶t̶s̶ ̶:̶ ̶h̶t̶t̶p̶:̶/̶/̶w̶w̶w̶.̶a̶l̶u̶c̶a̶r̶d̶j̶.̶n̶e̶t̶1̶6̶.̶n̶e̶t̶/̶u̶n̶i̶t̶y̶a̶n̶s̶w̶e̶r̶s̶2̶0̶1̶2̶/̶s̶l̶e̶n̶d̶e̶r̶g̶u̶i̶d̶e̶/̶

    v̶2̶.̶5̶ ̶a̶r̶e̶ ̶t̶h̶e̶ ̶s̶c̶r̶i̶p̶t̶s̶ ̶a̶t̶ ̶t̶h̶e̶ ̶e̶n̶d̶ ̶o̶f̶ ̶v̶i̶d̶e̶o̶ ̶7̶8̶
    v̶2̶.̶6̶ ̶a̶r̶e̶ ̶t̶h̶e̶ ̶s̶c̶r̶i̶p̶t̶s̶ ̶a̶t̶ ̶t̶h̶e̶ ̶e̶n̶d̶ ̶o̶f̶ ̶v̶i̶d̶e̶o̶ ̶9̶2̶

    The final scripts are attached to this post.

    The guide is split across 2 playlists. This is explained in this video : 00a _ Slender Again - The New Guide :


    The first part is in the playlist Programming and Making Games with Unity 3D
    The second part is in the playlist Slender Again - The New Guide

    // ----

    Hi There =]

    6 months after I started using Unity 3D I wrote a little 'guide' on Unity answers to a question about Slender. That turned out to be crazy, I never expected the amount of traffic and questions that was to come after that. Now ignorance is no excuse but i was naive, I didn't even know what a Slender was! The first time I answered a question for how to pick up papers, I thought it was for a RPG quest or a school project. When the how can the player detect when the enemy is visible questions came up, I was thinking about Doctor Who (if you know what I mean, you'll know. I want to do that one myself!). In summary I am trying to clean up my error.

    After nearly 17 000 views at current date I cannot just delete the whole thing, so what I've done is a video series of me doing my own guide. Hopefully this shows how to use the scripts I wrote back then, as there are so many copies of them out there now. Some bug fixes, some explanation, alot of me making my own mistakes. Any programmer will tell you when they look back on a project there is always thing they would do completely different, we are always learning and expanding our knowledge. So please keep that in mind while going through all my nonsense.

    The theme of this video series is " A guide written by a noob, for noobs "

    // ----

    The new video series has started. Programming and Making Games with Unity 3D

    In this series I will be hopefully be helping anyone that is new to programming understand what the words in the code mean, how to write your own code by learning some coding basics and rules, how to use and read the Unity Documentation and the Unity Scripting Reference. Then I shall move on to writing some scripts that can be used for more than one project, how to make your scripts work for you. Then I shall rebuild the Slender guide using new scripts and old scripts, then I shall see if we can make a totally different project using all the scripts we have written. This will be a long series, with a lot of mini tutorials along the way.

    Note : I have just started uploading the videos, so this part that follows will keep changing until all the videos are there and a playlist is made. Keep checking the change log at the bottom of this post.

    Here are the video links to the new series :

    * 00 _ Programming and Making Games with Unity 3D :


    * 01 _ Scripting Basics 1-1 : Variables :

    * 02 _ Scripting Basics 1-2 : Functions :

    * 03 _ Scripting Basics 1-3 : Different Variables :

    * 04 _ Scripting Basics 1-4 : Basic Conditionals : http://youtu.be/EhSKhK-GIYU
    * 05 _ Scripting Basics 1-5 : Basic Scripting Review : http://youtu.be/RdytseW3_Po

    * 06 _ Assets : How to find or make your own Assets : http://youtu.be/9nF39MzEFsU

    * 07 _ Terrain 1-1 : Create and Modify Terrain : http://youtu.be/L8lZTD079bM
    * 08 _ Terrain 1-1a : Terrain Toolkit for Unity 3-5 : http://youtu.be/XdfjO_hTMMg
    * 09 _ Terrain 1-2 : Trees and Grass : http://youtu.be/CiEHpuhYLZk
    * 10 _ Terrain 1-3 : Terrain Detail : http://youtu.be/W5vuI9CAdzI

    * 11 _ Character Controller : http://youtu.be/IxJ3objAfl4

    * 12 _ Ambience with Render Settings : http://youtu.be/fJ2cM-RSk1g

    * 13 _ Introduction to State Engine : http://youtu.be/9L8FQLKZeiQ

    * 14 _ Flashlight 1-1 : On and Off : http://youtu.be/PqaHwBNPSrI
    * 15 _ Flashlight 1-2 : Flickering : http://youtu.be/OueAwqO_sWw
    * 16 _ Flashlight 1-3 : Smart Variables : http://youtu.be/r6frYtqhbm4
    * 17 _ Flashlight 1-4 : Fading : http://youtu.be/PHeBWvFsYqE
    * 18 _ Flashlight 1-5 : Consumable Energy Source : http://youtu.be/RsNZz_EyERI

    * 19 _ Textures Materials and Shaders : http://youtu.be/CVKJ7izn8BI

    * 20 _ Vector3 1-1 : Position : http://youtu.be/-JbcPehemB4
    * 21 _ Vector3 1-2 : Direction : http://youtu.be/livAJQ0HdKo
    * 22 _ Vector3 1-3 : Rotation : http://youtu.be/HRlqvWmRgio

    * 23 _ NPC 1-1 : Moving : http://youtu.be/p9yLZmgkFWY
    * 24 _ NPC 1-2 : Colliding : http://youtu.be/7di6FnR7rqU
    * 25 _ NPC 1-3 : Grounded and Turning : http://youtu.be/78a1VSaaDuo

    * 26 _ Raycasting Basics : http://youtu.be/Sj4oxfQqzhA

    * 27 _ NPC 1-4 : Basic Obstacle Avoidance : http://youtu.be/JlulRhjLsNY
    * 28 _ NPC 1-4a : Basic Obstacle Avoidance : http://youtu.be/szxB6RBhVyQ

    * 29 _ NPC 1-5 : State Engine : http://youtu.be/F2sXFlDHzgg

    * 30 _ NPC 1-6 : Range : http://youtu.be/cmG3jURdFHg

    * 31 _ NPC 1-7 : Free Roaming : http://youtu.be/GKq0kaJWPqs
    * 32 _ NPC 1-7a : Free Roaming : http://youtu.be/_SJQP7lfpfw

    * 33 _ NPC 1-8 : Make it Slender : http://youtu.be/3Ny9CvliHNA

    // --

    From here on, Slender videos are in their own playlist. There are still other videos that go with these in the Programming and Making Games playlist

    * 00a _ Slender Again - The New Guide : http://youtu.be/0NelyTm6Tw8

    * 34 _ Dot Product : http://youtu.be/JAAGdF-Wdas

    * 35 _ Slender 1-9 : Is Visible : http://youtu.be/d5y4HMVyHlY
    * 36 _ Slender 1-9a : Is Visible : http://youtu.be/DJEZDP9n4xE
    * 37 _ Slender 1-9b : Is Visible : http://youtu.be/Urtg8ZmVxy8
    * 38 _ Slender 1-9c : Is Visible : http://youtu.be/N-kwbJJ9WMU

    * 39 _ Slender 1-10 : Tree Colliders : http://youtu.be/wGystZMcfv8

    * 40 _ Slender 1-11 : Teleporting 1 : http://youtu.be/vwC199Qmfbk
    * 41 _ Slender 1-11a : Teleporting 2 : http://youtu.be/-WJ5ZsfeUJ4

    * 42 _ Slender 1-12 : Building the Scene : http://youtu.be/Bk5KQjjI_gI
    * 43 _ Slender 1-13 : Light Cookie - and Forum : http://youtu.be/enG3DXQoug8
    * 44 _ Slender 1-14 : Collecting Papers : http://youtu.be/d1hyZm8UqPI
    * 45 _ Slender 1-15 : Using a Model : http://youtu.be/9hbjTOanljA
    * 46 _ Review of Scripts 1 : http://youtu.be/PcxNeh3QXvw
    * 47 _ Review of Scripts 2 : http://youtu.be/Fo7CCFgKouE

    * 54 _ Player Health 1-1 : http://youtu.be/4J4s9HE5W5Y
    * 55 _ Player Health 1-2 : http://youtu.be/q1yLjybZLw4
    * 56 _ Player Health 1-3 : http://youtu.be/YnhkWp2aB5k

    * 57 _ Static Screen Effect 1-1 : http://youtu.be/-o94sFGBYuE
    * 58 _ Static Screen Effect 1-2 : http://youtu.be/9HG3QkkHZos
    * 59 _ Static Screen Effect 1-3 : http://youtu.be/EMp9dCBeeiM
    * 60 _ Static Screen Effect 1-4 : http://youtu.be/HJ6n0Y29Lsw

    * 61 _ ... Check the videos in the Programming and Making Games with Unity 3D playlist ...

    * 64 _ Collect Paper Sound : http://youtu.be/2Zv2589sfGA
    * 65 _ Enemy Visible Sound : http://youtu.be/UPsK2jdYgRg
    * 66 _ Changing Music Track : http://youtu.be/hu7kpk1z6Ac

    * 67 _ Reduce Distance : http://youtu.be/9eFTdgQVojk

    * 77 _ Slender Assembly A : http://youtu.be/67kzXJrCRgQ
    * 78 _ Slender Assembly B - with Model : http://youtu.be/TwG4xP-Wyfo


    * 79 _ Slender the Examination : http://youtu.be/ppvST0a9rV4

    * 80 _ Slender Assembled A : http://youtu.be/rk4Ik-MdukQ
    * 81 _ Slender Assembled B : http://youtu.be/XICyvwYQhyQ
    * 82 _ Slender Assembled C : http://youtu.be/f8EO4oXswh0
    * 83 _ Slender Assembled D : http://youtu.be/2FShJxgxT-A

    * 84 _ Another Flashlight Script : http://youtu.be/c4yA1MdY4_Y
    * 85 _ Player Clamp To World : http://youtu.be/eUcqd89OiSc
    * 86 _ Better Teleporting : http://youtu.be/TRMjPLczCiI
    * 87 _ Separate Music Manager : http://youtu.be/UppHwddLUyo
    * 88 _ Player Run And Footsteps : http://youtu.be/HLxqEvT4Z8k

    * 89 _ Display Paper A - Display the Paper : http://youtu.be/AJ3ewNCl7KI
    * 90 _ Display Paper B - Scaling the Display : http://youtu.be/5T0RsQB7vNo
    * 91 _ Display Paper C - Offset the Texture : http://youtu.be/Ys5q7a43-6k
    * 92 _ Display Paper D - Particle Effect : http://youtu.be/DUamRFVNkUM

    * 98 _ ... uploading soon ...


    I apologize now as the sound is still not great, after testing different microphones and configurations, I found the problem was .... me. For the most of the time I do speak softly, and even though I try to remember to speak loudly, once I get going then focus on my voice is lost. I am sorry, hopefully all the required information appears on the screen anyway, so as long as you can see what I am pointing to, what links I am opening, and pause to copy what code I am typing, then everyone will still learn and benefit from my videos, this I really hope for.


    // ----


    The old guide is gone. It got old and a bit mad, so we took it to the vet and said our goodbyes ....

    There is going to be a whole new guide, this will be easy to follow along as everything will be shown starting from a blank project! All scripts and instructions will be in the videos. The new video series will be starting halfway through March. And yes, I'm buying a new microphone!

    For now, here is the old guide :

    The original written guide to follow along with : http://answers.unity3d.com/questions/296068/how-to-make-a-slender-man-follow-character-script.html

    Here are the Video Links :

    Slender video 1 : Setting the Scene : http://youtu.be/-6c3dv-bAns
    Slender video 2 : Collecting Papers : http://youtu.be/ggjAtu0WDF8
    Slender video 3 : The 'Man' : http://youtu.be/SVqhcKJIUEM
    Slender video 3a : The 'Man' : http://youtu.be/SiZcI0J16Fk
    Slender video 3b : The 'Man' : http://youtu.be/SRWlljfSZdM
    Slender video 4 : Running and Footsteps : http://youtu.be/8Up51g9qlGI
    Slender video 5 : Static Screen pt1 : http://youtu.be/ADCXi0HUJyQ
    Slender video 6 : Static pt2 and Build Settings : http://youtu.be/ci2cFcVq_Ok
    Slender video 7 : Scenes and Lock Cursor : http://youtu.be/2wBxrMdrawU
    Slender video 8 : Speeding up enemy and Clamping player : http://youtu.be/wVu3Chptu5M
    Slender video 11 : Change to Collect Papers using SphereCast : http://youtu.be/km9224GBhJM

    Slender video 9 : Collecting Papers from Scratch using Raycast : http://youtu.be/-XIaWweMwH4
    Slender video 10 : Collecting Papers from Scratch using SphereCast : http://youtu.be/JaOsHCV_SZQ


    The pages and 3D Model I use are not mine, but can be clearly found if you read the written guide ! Terrain textures and assets and other models are all found in the asset store. Just check out 3D Models > Environments and > Props . For Terrain or other surfaces check Textures Materials . ( super hint : you can sort by / price / ).

    The one direct link to the very latest versions of all the scripts (well currently only videos 1-7, but 8 is easy to follow and add yourself) : http://answers.unity3d.com/questions/409270/what-happened-to-the-slender-guide-by-alucardj.html


    // ----

    Links from the videos

    Crash course in Unity (start at the bottom and work up) : http://www.unity3dstudent.com/category/modules/

    Assets : Models and Textures :

    http://answers.unity3d.com/questions/16650/game-asset-website-list-free-and-paid-textures-mod.html
    http://thefree3dmodels.com/

    Assets : Audio :

    http://answers.unity3d.com/questions/7743/where-can-i-find-music-or-sound-effects-for-my-gam.html
    https://soundcloud.com/groups/movie-game-background-music-soundtrack-music
    http://www.melodyloops.com/music-for/games/
    http://www.playonloop.com/music-loops-category/videogame/

    Assets : Making your own Assets :

    http://www.blender.org/
    http://www.gimp.org/
    http://audacity.sourceforge.net/

    http://www.3dbuzz.com/
    http://cgcookie.com/blender/
    http://www.youtube.com/user/vscorpianc?feature=watch (for Blender and GIMP)

    Terrain (for Unity 3.5 only) : SixTimesNothing (Terrain Toolkit and Road/Path tool) : http://www.sixtimesnothing.com/tools-and-resources/

    Introduction to Character Controllers : http://cgcookie.com/unity/2011/12/05/introduction-to-character-controllers/


    // ----

    Requests :

    Where can I find assets (audio, models, etc) for my game?
    * In the Asset Store, check out 3D Models > Environments and > Props . For Terrain or other surfaces check Textures Materials . ( super hint : you can sort by / price / ).
    * resource info link : http://answers.unity3d.com/questions/16650/game-asset-website-list-free-and-paid-textures-mod.html
    * resource info link : http://answers.unity3d.com/questions/7743/where-can-i-find-music-or-sound-effects-for-my-gam.html

    How to play an animation on a model ?
    * I shall include this in the new guide. Until then, check out the Unity Scripting Reference : http://docs.unity3d.com/Documentation/ScriptReference/Animation.Play.html

    Can we make a RTS style game?
    * Yes, though this is one of the hardest genres to make. My next video series will be looking at how to make a RTS, and show the things you will absolutely need to master to make your own RTS. Still working on this current video series, but yes that will be the next one =]

    // ----

    Don't stop here, read everything !

    This is certainly Not the only and definitive answer for all things Slender. You should always try and look at a problem from every possible angle (that way you usually find all the ways that things could go wrong too). Here is a list of links that I made at the time just before writing my guide :

    http://answers.unity3d.com/questions/287355/slender-like-game.html
    http://answers.unity3d.com/questions/296068/how-to-make-a-slender-man-follow-character-script.html
    http://answers.unity3d.com/questions/319733/how-to-make-enemy-kill-you-if-starring-at-it.html
    http://forum.unity3d.com/threads/134862-Slender-Man-Design-Outline
    http://www.parsecproductions.net/slendermangame.txt
    http://forum.unity3d.com/threads/141488-Slender-Beta-0.9
    http://forum.unity3d.com/threads/138399-Slender-Man-WIP
    http://answers.unity3d.com/question...g-Track-of-how-many-collected--need-help.html
    http://answers.unity3d.com/questions/323129/if-anyones-looking-for-a-flashlight-script-with-a.html
    http://answers.unity3d.com/questions/316189/i-want-to-turn-my-flashlight-on-and-off-while-stil.html
    http://www.youtube.com/watch?v=nmvCaqNGEFU&feature=related
    http://answers.unity3d.com/questions/15438/trying-to-pick-up-and-see-paper-pop-up-gui-window.html
    http://answers.unity3d.com/questions/321749/how-do-you-pick-up-pages-like-in-slender.html

    // ----

    Change Log (what has been added to the above) :

    Mar 10 2013 : uploaded videos 84 to 92 : Adding In a Whole Bunch of Stuff to Finish This Game and Make It a Little Better.

    May 9 2013 : uploaded videos 80 to 83 : Building a Scene With All the Current Scripts

    May 7 2013 : uploaded video 79 : A Look At All The Current Scripts

    May 6 2013 : uploaded videos 77 to 78 : Trying To Look At And Find Where Some People Cannot Get This Built

    May 4 2013 : uploaded videos 64 to 67 : Adding Audio, enemy reduce distance

    Mar 27 2013 : uploaded videos 48 to 60 : GetComponent, PlayerHealth, Static Shader and Screen Effect
    Mar 26 2013 : uploaded videos 28 to 47 : Developing NPC, building a scene with all the information given so far
    Mar 19 2013 : uploaded videos 19 to 28 : Textures, Vector3 and Rigidbody NPC
    Mar 17 2013 : uploaded videos 12 to 18 : Ambience, State Engine and Flashlight
    Mar 13 2013 : uploaded videos 06 to 11 : Assets, Terrain and Character Controller
    Mar 12 2013 : uploaded videos 00 to 05 : Introduction and Scripting Basics
    Mar 12 2013 : Start of the New Video Series

    Mar 5 2013 : New video 11 on using SphereCast to collect papers. Much better results !
    Mar 5 2013 : Stand-Alone video 10 uploaded (Collecting Papers from Scratch with SphereCast).
    Mar 4 2013 : Stand-Alone video 9 uploaded (Collecting Papers from Scratch with Raycast).
    Mar 3 2013 : Video 8 uploaded to youtube (speed up enemy and clamping player).
    Mar 1 2013 : Videos 1 to 7 uploaded to youtube.
    Feb 28 2013 : The first videos (1-7) are recorded.

    // ----
     

    Attached Files:

    Last edited: Jul 24, 2016
    Kurt-Dekker, razamgar and maria-dev like this.
  2. Baskyn

    Baskyn

    Joined:
    Feb 17, 2013
    Posts:
    67
    Really cool series!
    What did you mean about the Doctor who thing? Something with the silence or weeping angels? o_O
     
  3. EvansGreen

    EvansGreen

    Joined:
    Nov 9, 2012
    Posts:
    129
    Hey! I thought I would just drop by and say THANK YOU, not specifically because of your guide, not specifically because of your videos, but because how actively and altruistically are you always helping everybody on Unity Answers, and also adding interesting questions and material of discussion to the different pages (like Unity Gems).

    I feel like you're really doing the right thing helping the community instead of sending everybody back to "google", or telling off new people for asking newbie questions.

    Thanks ;).
     
    DoctorSauce likes this.
  4. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    Thanks Jay Kay.
    Here is my second question:

    - The asset links are dead. Where can i found them???
     
  5. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Baskyn : Thankyou, and yep ;) you got it =]

    EvansGreen : Thankyou that is awesome, I really like helping people but like to know it too! Yeah my pathfinding sorta works but not completely (it sometimes zig-zags but gets there no worries). I hope you find something useful there in my answers or videos yourself. Those were from 2 nights ago, and I'm already planning some other videos in my head.

    Slendyberkay : Thankyou too =] sorry the packages are out of date and gone. The only option right now is to watch the videos from the start, and go to link at the top for all the scripts from that video series. If you have the original written guide link you can still follow along there and use the scripts. Have Fun !

    Edit : If you are looking in the asset store for models and assets to use, check 3D Models > Environments and > Props . For Terrain or other surfaces check Textures Materials . ( super hint : you can sort by / price / ).
     
    Last edited: Mar 2, 2013
  6. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    I searched and found these:

    - http://u3d.as/content/profi-developers/building-shed/21X
    - u3d.as/content/unity-technologies/shanty-town-concrete-pipe/1rH
    - u3d.as/content/universal-image/oil-tank/1QK
    - http://u3d.as/content/unity-technologies/shanty-town-rock-formations/1rQ
    - http://u3d.as/content/unity-technologies/shanty-town-brick-wall-exposed/1rZ
    - http://u3d.as/content/unity-technologies/shanty-town-brick-wall-wet/1s0


    these are the building shed, pipe, rocks, wall (cracked), wall

    too bad i couldn't find fence for free

    edit:
    i found it(not original one) here it is:
    -http://u3d.as/content/ben-droste/stone-fence/2vM
    just looks good
     
    Last edited: Mar 2, 2013
  7. Annihlator

    Annihlator

    Joined:
    Oct 15, 2012
    Posts:
    378
    It's nice also to have a clear reference point to turn all those slender questions to.

    It's often most frustrating (to me) when these questions come that in many cases people seem to have thought for not even a split-second (usually these questions even seem to ask for someone to write the exact script).

    Also often people say they have looked for the question and found nothing, which sometimes made sence because it's hard to think it might help to search in terms as "Detect when object is near" or "Detect when player is near", and those are completely understandable and basic questions when someone is only just starting out in unity... But instead they... they... okay, i honestly have no idea how you can -not- find that answer, but people manage to apparently.

    All around the net there are many well-written unity tutorials about any level of scripting, shader programming, texturing, et-cetera...

    But i'm starting to wonder... wouldn't it be a good idea to try to obtain a "sticky"/announcement thread where we can try to add some well-known tutorials and links. (including this one)

    We could have the subjects divided in a clear way, having titles such as "Finding an Object" "Levers, switches and doors" "Moving Players, Objects and NPC's"



    ... I was looking around the forum trying to find some examples, and stumbled on this topic which seems to take the direction of grouping learning sources http://forum.unity3d.com/threads/170898-Unity-tutorials but didn't want to ditch this whole post. i'm curious :)
     
  8. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Annihlator : these are all fantastic points and ideas, btw am new to having any online presence apart from UA, I don't know how to do a 'sticky' thread ! If anyone can help out there. And if you would like to add this resource to another list, I guess that is fine, my only problem is these scripts are old and I want to show better ways of doing things, techniques you can use for all projects. This is where my videos will be going.

    The original 'guide' answer was to hopefully stop 2 of all the same type of question (how to pick up, when is enemy visible), but I got that wrong! And yes you can see the trend in the types of questions, so there need to be a way of showing how to use all these components and commands to work with each other. Absolutely there are so many instructional resources out there, I would be lost without reading/watching. There are cases where people just don't know the terminology, or that something even exists. Hopefully everyone will learn at least one thing (even just how to not do something from my mistakes), that would be fantastic.

    The real aim of this particular page was to stop all the different questions using my scripts on Unity Answers. So far it looks like everyone is finding this page and then the videos, and I havn't seen any new questions on UA which is great. As you can hopefully see, on this page I will always do my best to answer Any question, even the ones that get shot down in the Answers.

    What I can do Is keep changing the first post as everyone likes, if you have a slender link I can put it with mine, then we can make a directory of all the different parts of slender. Something like :

    * terrain , model and audio assets
    * first person controller and scripts (running, audio etc)
    * all ways to collect items
    * all ways to know if an object is visible to the camera
    * how to talk to other scripts
    * special effects
    * anything I cannot think of right now

    This is exciting. Like I said at the start, this was written a long time ago now, and there are better ways to do things I can show. We could do this whole thing again, but in a way that builds these different scripts that you can use again and again on lots of different projects. For example, my next video would be how to collect an item using a trigger zone. But in this I would teach how to use GameObject.Find and GetComponent. Then we would make different trigger zones : to collect items, to use as a switch to open a door, etc.
     
    Last edited: Mar 3, 2013
  9. Annihlator

    Annihlator

    Joined:
    Oct 15, 2012
    Posts:
    378
    Alucardj, you seem to think about what is "the problem" the same way as i do, that feels great i must admit!
    Maybe through some personal messages to the unity staff on these boards we'll be able to draw some attention.
    I'll see if i can put up an example for a sticky thread. i used to do those kind of things for a Cinema4D Community in the past too!
     
  10. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    Thanks Jay I made this time but sometimes "fog" doesn't appear and it looks like a sunny day.
    And i need someone to make me a material for my monster
     
  11. Annihlator

    Annihlator

    Joined:
    Oct 15, 2012
    Posts:
    378
    Come on man, i always hope with such an attitude, that no-one will help (that is, in making the material itself FOR you).
    Try asking those things, or how to do something instead of assuming someone will simply do it for you in the end... okay?

    Can you tell more about your monster? (or which model it's using, i.e.... i'm not going to read through the whole tutorial right now.)
     
  12. EvansGreen

    EvansGreen

    Joined:
    Nov 9, 2012
    Posts:
    129
    Highly, highly unlikely. If it's quality you're looking for. I tend to agree with Annihlator here. You should learn a thing about collaboration ;). Quick tip, nobody make YOU some quelity product for YOUR game for free. Either change your semantics or pay them.

    Sorry if I sound a bit cynic but I felt like you'll find use for this criticism if you don't take it badly.
     
    Last edited: Mar 4, 2013
  13. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    Jay

    I need help.
    I said I was very new to unity and I wanna ask you something...

    I wanna add extras to ending(WIN) but i have no idea how to add another button thing.

    I wanna make something like this when player win game;

    Button says You win!
    Another button says Extras

    Can you give me
     
  14. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    Oh I made it myself. Thanks for help again. :D

    #pragma strict

    function Start()
    {
    Screen.lockCursor = false;
    }

    function OnGUI()
    {
    if ( GUI.Button( Rect( (Screen.width * 0.5) - 75, 10, 150, 50 ), "You Won !" ) )
    {
    Application.LoadLevel( "SceneMainMenu" );
    }
    if ( GUI.Button( Rect( (Screen.width * 0.5) - 75, 150, 150, 50 ), "Extras !" ) )
    {
    Application.LoadLevel( "SceneMainMenu" );
    }
    }

    Will chance SceneMainMenu with SceneExtras :D
     
  15. Annihlator

    Annihlator

    Joined:
    Oct 15, 2012
    Posts:
    378
    Very well done, if i may say :)
    You can also use GUI.Label for displaying just text by the way.

    And a question like you posted just before, i wouldn't mind answering at all :)
     
  16. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Hi there, excellent going. Didn't really cover the GUI sorry, was focused on the questions with loading level so only described that. Doing the videos I can see alot that could be done better there too, and in future all episodes will show every Unity Scripting Reference for every command I use.

    This page is for everyone to contribute to, so please help each other (and me !). There will be some expectations : this (and my future videos) is aimed at helping new users of Unity, but I am not writing your game for you. Some things like assets you really have to search for or try making yourself. There are oodles and oodles of tutorials out there for everything, keep searching. Notice words people use to describe things (like UV mapping), search on those and you will get closer!

    The videos were so I could stop answering questions and 'pass on the torch' to the community, but they are all wrapped around my old scripts. Straight away there were questions, and looking at these scripts again as I explain and edit them, it's not going to stop. Don't take this the wrong way, I have been absolutely blown away by the positive response. Not even a week after the videos were posted, the original written guide has had 1000 more visitors, and the youtube view statistics after 24 and 48 hours alone were just incredible.

    So I have decided to make a new guide , yes you heard correct and you heard it here first. Annihlator you have inspired me, thanks for your kind words, and it does seem like we 'see' some of the problems arising with an ever growing pool of (new to programming) Unity users. As in our last comments, I shall be trying to show everyone some more general practices, so while this shall be aimed at Survival-Horror, hopefully the things you learn and the scripts you write are then ready to use in all your other projects. A great example is out of all the scripts that need a state engine, the only one is in the flashlight script. This is just one of the many practices I want to show other people how to use for themselves.

    You can see this with the new standalone video for collecting papers, I already have another standalone video idea to record and upload tonight. Then I shall be adding that to the old scripts, then this is the last time I shall be working on the old scripts. There shall be a new series for Slender, then some completely separate video playlists for specific topics (currently planned are trigger volumes, and raycasting). Within these separate playlist I shall cover alot of the basics like GameObject.Find and GetComponent.

    Something I have learned is I shall not be providing my scripts to just copy anymore. To get the scripts, people have to do the videos. This seems harsh, but again shall actually benefit those who want to learn, and force those who just want to copy to have to do the videos.

    Keep checking my first post, this is constantly changing. Something else learned, I shall add a change log to the bottom of the first post, so everyone can see what's changed or been added quickly. So with my quality of videos, sorry and I'm trying to make them better. With the way I explain things, that is me so is not going to change, hope my words my mistakes and fixing my mistakes shows everybody something they can learn from.

    Coding is like Lego : all the pieces are the same : what you make from them is where the magic is !

    I can show you how I understand the pieces, the rest is up to your imagination and motivation =]


    Edit : ok so the first question appeared on Unity Answers, so it made me think I need to add a 'request' part to this forum page. So from now, let me know here any requests you have, and they shall be added to the list at the top of the page.
    The first request is from poopdaloop : How to make an model an enemy? Seriously i have made a model and i have put a couple scripts in the model but still nothing changes can any of you help me out ?

    Ok so I think this is asking how to play an animation on a model. This I shall do soon ok !
     
    Last edited: Mar 5, 2013
  17. MonsterGamingHD

    MonsterGamingHD

    Joined:
    Feb 15, 2013
    Posts:
    39
    alucardj, do you have a skype? I really need help witha slender game I am wporkoing on. It is going ery well. I am only 12 years old though. But the game is coming out to look professional. Also, I need some help with scripts and others. Please help me ?
     
  18. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Hi MonsterGamingHD, your game is sounding good ! I have never done any 1-on-1 help before, not sure if I could, and I would like this page to be for everybody. But don't be afraid to ask ANY question here (except why does a brown cow give white milk when it only eats green grass!), here is not like Unity Answers, any question on this topic is A OK. Also I am working hard in my spare time to finish my new guide, I am trying to add some basic programming stuff to help new users learn how to read and write code. If your question is something you really think is unique to your game then send me a PM (private message) and I'll see what I can do to help. Up the top where it says 'Welcome, MonsterGamingHD' click on your name, then click on 'Send Private Message'. If I can help I shall, and there will be lots of free time after the new videos are up (unless I get a ton of new questions, but you did ask first!). If you have a problem that I think will help everyone, I will keep your code a secret but may tell this page how to fix that type of problem if it happens to them with a completely different example. Just send me one problem at a time though, ok, whatever is the first thing that is stopping you from continuing your game. Hope to see some screenshots when it is finished. So this is a yes I shall try to help, sorry I don't really skype except to family overseas, but you can ask me anything here or in a PM.
     
  19. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    Kay, I'm adding extras to my game. The levels will be:
    - Day Mode
    - Stripteaser mode
    - Hunting Mode

    I have no problems for Day Mode. Just copy scene and name it Level 1 and change SceneWin code no more.
    Here is my first question. I ll use a sexy anime chick for stripteaser mode and i want to make it like it is in a pavilion. And change papers with 1/4 of a anime drawing.
    So first question is:
    What happens if I chance all 'paper's from code and write 'poster part's?
    Does this makes a problem? ( I ll save as Lev 2CollectPapers)
    For hunting mode I'm going to add a FPC with no flashlight and a player named paper and i will set PapersToWin with 1 and can u give me a script for player to move away **everytime** .
    And i'm going to make player red glowing and yellow maybe. How can i make infrared look... ??? ???????

    And I searched "slender clone" and found "Nıghtmare (slender clone)" and i think it's main menu is COOL so can u prepare me scripts for a menu like this?
    I need it.
    Please respond.
     
  20. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    please reply. Someone I need help doing these.
     
  21. stynex

    stynex

    Joined:
    Mar 4, 2013
    Posts:
    1
    Alucard just WOW man what an amazing tutorial! I don't think us Unity noobs could ask for a better step-by-step walkthrough. Its awesome to see someone put the time and that much effort into helping others get on there feet with Unity and learning there way around the program!! Ill deff be watching out for any other tuts you may be getting into. Keep up the good work man. But as idiot proof as you've made it, I do have one dilemma. Is anyone else having problems getting the teleport script to work?? I've followed the video tuts about 1000 times to make sure i didn't miss a step. I've tried debugging: prefab models, created models, adjusting variables, new terrains, even restarting projects. But no luck. The follow works great, but I just don't ever get a slendy teleport. I don't give up easily, but I'm pretty much out of trouble shooting ideas lol. Any help would be great thanx guys.
     
  22. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Hi Slendyberkay, well I just missed your post last night, and I havn't really slept, so let's see if I can work out your questions. You have some unique ideas, which is good !

    1/ If you only have 4 papers (poster parts), then make sure you change the variable papersToWin to 4 also. This variable is for the total amount of collectible items in the scene.

    2/ Yes it is possible, For the new guide I have just written a new rigidbody character controller for the enemy, this could be used for the 'paper' NPC ( great idea, I like it ! ). That video should be there by next weekend if not before, please be patient for that. If not, a version without simple obstacle avoidance can be found here, but you'll have to change the code so the NPC goes in the opposite direction (not follow the player) : http://answers.unity3d.com/questions/406685/my-enemies-merge-when-they-come-towards-me.html
    C'mon, that's a good script. Why do I rarely get upvotes for my answers?! Never mind, that's just the tired me talking. To make the NPC run away, all you have to do is change the line :

    desiredVelocity = myTransform.forward * moveSpeed;

    to this :

    desiredVelocity = -myTransform.forward * moveSpeed; // NOTE THE NEGATIVE SIGN

    3/ The infra-red / night vision stuff I am very interested in, but I don't know anything about shaders, so that is something we all have to find out (and I really want to as well). I lloked in the asset store, and there is one but all it does is put a transparent texture infront of the camera, pretty much exactly the same as my static script. So you could try that out, make a see-through red material, then add it to another gameObject with my static script, disable the alpha from that and then there will be a full-screen filter in front of the camera. Or you could just scale a cube right in fron tof the camera with that see-through material, then parent that cube to the camera so it stays in place when moving.

    4/ wow I remember those Nightmare guys asking me to visit their facebook page. That was really strange watching someone review my scripts in another project! I got worried when he talked about the flashlight at first, but like he said, it got him, so that was the effect I was after! I also liked the suggestions he made, hopefully I can add some of these to my new guide(like bringing the enemy near when the player is close to or just collected a paper. Maybe the flashlight should only start to flicker when he is close to. Hmm, too much work already, and too much more to think about adding! Here is a 3D menu tutorial for the same menu as they seem to use : http://www.youtube.com/watch?v=Z8YGKQvEz1Y

    hey, please give 24 hours for a reply. And for some reason I am not getting emails when there is a new post here (I checked the settings, it's all the UDN changes).
     
    Last edited: Mar 9, 2013
  23. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Hi stynex, well that is no fun at all. So you have the InvokeRepeating in the Start function. That calls TeleportEnemy(). First check the spelling of the name of your terrain in the raycast part, is your terrain named "Terrain" ? if ( hit.collider.gameObject.name == "Terrain" )

    Now right above that line if (hit.collider. .... ) put your debug there to return what the raycast hits. This way you can check that theraycast is actually being seeing anything, and find out exactly what the name of the colliders object that the raycast is hitting. Debug.Log( "teleport ray hit : " + hit.collider.gameObject.name );

    In that function, there is a distance set high in the air for the raycast to start from (newPos.y = 1000;) then the raycast comes down for 1000. My question would be : is your terrain lower than 0 in the Y-axis? If so, increase that number in the raycast. If you're unsure just use Mathf.Infinity . if ( Physics.Raycast( newPos, -Vector3.up, hit, Mathf.Infinity ) )

    so those lines would fit in like this :

    Code (csharp):
    1. var hit : RaycastHit;
    2. if ( Physics.Raycast( newPos, -Vector3.up, hit, Mathf.Infinity ) )
    3. {
    4.     Debug.Log( "teleport ray hit : " + hit.collider.gameObject.name );
    5.     if ( hit.collider.gameObject.name == "Terrain" )
    6.     {
    7.     ........
    Good Luck, let me know if it was one of these. Just check the name of the terrain first, it could be just that. It will only work if the ray hit terrain, so it doesn't put the enemy on a building or tree or on the players head (that would be a bullseye of a raycast!). Then add the Debug next, this checks : if the raycast is reaching; and what the raycast is seeing. Finally add Mathf.Infinity.

    Thanks for your awesome comments =]
     
    Last edited: Mar 9, 2013
  24. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    Jay , I tried making this 3d menu and done it but in the video camera can rotate a few degrees but in my game there is no rotation. How can i make my camera rotate only a few degrees?
     
  25. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. /// MouseLook rotates the transform based on the mouse delta.
    5. /// Minimum and Maximum values can be used to constrain the possible rotation
    6.  
    7. /// To make an FPS style character:
    8. /// - Create a capsule.
    9. /// - Add a rigid body to the capsule
    10. /// - Add the MouseLook script to the capsule.
    11. ///   -> Set the mouse look to use LookX. (You want to only turn character but not tilt it)
    12. /// - Add FPSWalker script to the capsule
    13.  
    14. /// - Create a camera. Make the camera a child of the capsule. Reset it's transform.
    15. /// - Add a MouseLook script to the camera.
    16. ///   -> Set the mouse look to use LookY. (You want the camera to tilt up and down like a head. The character already turns.)
    17. [AddComponentMenu("Camera-Control/Mouse Look")]
    18. public class MouseLook : MonoBehaviour {
    19.  
    20.     public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2 }
    21.     public RotationAxes axes = RotationAxes.MouseXAndY;
    22.     public float sensitivityX = 15F;
    23.     public float sensitivityY = 15F;
    24.  
    25.     public float minimumX = -360F;
    26.     public float maximumX = 360F;
    27.  
    28.     public float minimumY = -60F;
    29.     public float maximumY = 60F;
    30.  
    31.     float rotationX = 0F;
    32.     float rotationY = 0F;
    33.  
    34.     Quaternion originalRotation;
    35.  
    36.     void Update ()
    37.     {
    38.         if (axes == RotationAxes.MouseXAndY)
    39.         {
    40.             // Read the mouse input axis
    41.             rotationX += Input.GetAxis("Mouse X") * sensitivityX;
    42.             rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
    43.  
    44.             rotationX = ClampAngle (rotationX, minimumX, maximumX);
    45.             rotationY = ClampAngle (rotationY, minimumY, maximumY);
    46.  
    47.             Quaternion xQuaternion = Quaternion.AngleAxis (rotationX, Vector3.up);
    48.             Quaternion yQuaternion = Quaternion.AngleAxis (rotationY, -Vector3.right);
    49.  
    50.             transform.localRotation = originalRotation * xQuaternion * yQuaternion;
    51.         }
    52.         else if (axes == RotationAxes.MouseX)
    53.         {
    54.             rotationX += Input.GetAxis("Mouse X") * sensitivityX;
    55.             rotationX = ClampAngle (rotationX, minimumX, maximumX);
    56.  
    57.             Quaternion xQuaternion = Quaternion.AngleAxis (rotationX, Vector3.up);
    58.             transform.localRotation = originalRotation * xQuaternion;
    59.         }
    60.         else
    61.         {
    62.             rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
    63.             rotationY = ClampAngle (rotationY, minimumY, maximumY);
    64.  
    65.             Quaternion yQuaternion = Quaternion.AngleAxis (-rotationY, Vector3.right);
    66.             transform.localRotation = originalRotation * yQuaternion;
    67.         }
    68.     }
    69.  
    70.     void Start ()
    71.     {
    72.         // Make the rigid body not change rotation
    73.         if (rigidbody)
    74.             rigidbody.freezeRotation = true;
    75.         originalRotation = transform.localRotation;
    76.     }
    77.  
    78.     public static float ClampAngle (float angle, float min, float max)
    79.     {
    80.         if (angle < -360F)
    81.             angle += 360F;
    82.         if (angle > 360F)
    83.             angle -= 360F;
    84.         return Mathf.Clamp (angle, min, max);
    85.     }
    86. }
    87.  
    i found this edited mouse look script :D
     
    Last edited: Mar 12, 2013
  26. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    Hey, I found an awesome prototype project and I just wanna ask you how can I make something like this.

    https://www.google.com.tr/url?sa=t&...rp6vnQ5gZBKidmEMA380XzA&bvm=bv.43287494,d.Yms

    or how can i make a game like plague inc.?

    Note: I finished the game on brutal difficulty. It is an awesome game. In game you are trying to destroy humanity with a deadly disease. If you activate deadly symptom genes goverments will find your disease and they start to close borders, airlines vs. They also gives fund to research. When they find the cure everything is finished. First you select where your plague will start then add abilities like
    - bacterial shield - air infectivity - sea infectivity - livestock infectivity - drug resistance and the list goes on.

    Sorry for bad English.

    How can i make a game like these above?
    Will you make a tutorial for these?

    Edit : No I haven't stopped working on my slender clone :D (i added the monster, positioned all the pages) made extras ( currently have only Day mode ) . Added 3d menu. Added better sounds. I just wanna make another project. Not a clone. I will make an original strategy game which is like plague inc or [un-named project]. or both of them :D

    Can you please make a tutorial?

    Doesn't this sounds awesome???
     
    Last edited: Mar 10, 2013
  27. MegaStevenLP

    MegaStevenLP

    Joined:
    Feb 27, 2013
    Posts:
    69
    My Enemy wont follow me if i add a Model.
    If its a Cube, he follows me all the Way.
     
  28. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,664
    Make sure your enemy has the right script attached. Otherwise look whats different between the cube and your model (apart from the apperance).
     
  29. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Well even though my email settings are set to email me as soon as a new post arrives, I only now just got notice of these posts. Sorry everyone. Have also been busy with the new videos so not been checking here very often this week.

    MegaStevenLP : It sounds like you havn't dragged and dropped your model onto the enemy collider object (this is the object that has the capsule collider, rigidbody and the script attached). For a test : without the game running, in the hierarchy window, click on your enemy. Now in the scene view, drag that gameObject around. Does the model also move? If not, in the hierarchy window, drag and drop your model onto the enemy collider object. Now the model is a Child of the enemy object, so wherever the Parent goes, the Child goes. And as stated by Mauri make sure you have your scripts attached to the correct gameObjects, and for your model make sure the model is a child of the enemy obejct with the script. Thanks for helping Mauri =]

    slenderberkay : in the GUI video I linked, at 1:50 he loads the scene he made, he doesn't show it but when the cammera was added he attached the Unity Mouse Look script to it. But you found a way to make it work with another mouse look script so that is excellent. Just as a tip, when sharing code for other users it is really helpful if you make it appear as code.

    How to post code in a comment here on the forums :
    * click on the link under your post : Edit Post
    * look where it has 3 buttons : Save Go Advanced Cancel
    * click on : the button : Go Advanced
    * now highlight all your code
    * click on the symbol at the top that is # . When you hover over this icon the tooltip states "wrap CODE tags around selected text"
    * finally click on Save Changes

    now your code should appear as code, indented and ready for everyone to copy and use.

    Regarding that video : yes, it's awesome! and totally possible, though really hard. I only just made my first RTS at the end of 2012, and it still isn't fully working let alone polished. And I havn't done my own inventory for any project yet! Well that said, there is alot you can learn to get started. The biggest thing is Raycast.

    Hopefully people can see my new videos are not just about making a Slender game, but learning all the different types of things that Unity can do, and also write scripts that can be used in more that one project (even with completely different behaviour on the same script). What I'm getting at is yes I want to show how to make other games. The one you suggested is a biggie ! Managing same inputs for different commands, writing and using classes, pathfinding, making objects aware of other objects in a changing environment, lots of pro stuff, but still it is possible for us non-pros!

    The next game and the videos I do will teach you everything you need to get started on making this project. There was actually a guide I wrote before Slender, based on the iOS game Air Controller. The next game (videos) will be a total rewrite of that project (at the time, I had no idea on how to use arrays, now I can show people Built In Arrays, and more importantly Lists ). If you want a head start, or just want to check out something with Raycast and waypoints, here is the link to the original answer : http://answers.unity3d.com/questions/231349/object-follow-the-mouse-path.html .Keep in mind this is very old code now, only about 2 months after I started using Unity. When I rewrite this project the script will be very different, hopefully improved. But for now, enjoy.
     
    Last edited: Mar 12, 2013
  30. MegaStevenLP

    MegaStevenLP

    Joined:
    Feb 27, 2013
    Posts:
    69
    @alucardj

    Ive done all that, he follows me but in a verryy wide distance.
    And he dont comes closer.
     
  31. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    You shoul make positions XYZ - 0 to make model fit in Enemy Object...
    It follows closer if you made everything true. It follows closer when you pick a paper up. I made it and I don't know what have you done wrong...
     
    Last edited: Mar 12, 2013
  32. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    MegaStevenLP : ok so I shall make a guess that your model has an animation component attached. And that animation is set to Play on Awake, and the default animation that has come with the model is repositioning itself on play. While watching the scene view, hit play. Does the model move? If so then my guess is probably it. If not, then I am sorry but am having trouble understanding the exact problem.

    These are the steps : create an empty gameObject. Attach a capsule collider and a rigidbody. Name this object Enemy. Attach the enemy script. Now drag your model into the scene. Make it a child of the Enemy gameObject (as described in my last post). Now everywhere the enemy goes, the model will go.

    " My Enemy wont follow me if i add a Model. If its a Cube, he follows me all the Way. "
    "Ive done all that, he follows me but in a verryy wide distance. And he dont comes closer."

    With what you have written, this is the best and only help I can give. Maybe you could show a screenshot of the scene view and the Inspector. Click on the enemy, make sure it can be seen in the scene view, then take a screenshot (alt+PrintScrn, open Paint then ctrl+V). Post it here so we can see how your enemy object is constructed.

    Well the new videos have started, and no-one is watching? It it me? Is it because it's not just for Slender? Is it the boring theory? Is it because I havn't got some groovy AI stuff happening yet? This is coming, but from all the questions that came after the written guide, I have learned that everyone needs to learn some coding to understand what I am trying to do here, help people read and write code for themselves, then using these principles make some awesome games ! Stay tuned, and keep watching the change log for new videos.
     
    Last edited: Mar 13, 2013
  33. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    They are awesome. i ll watch them later
     
  34. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Thanks dude! You probably know all the stuff in the first videos anyway! Check out the Terrain Toolkit video if you are using Unity 3.5
     
    Last edited: Mar 13, 2013
  35. DoctorSauce

    DoctorSauce

    Joined:
    Nov 4, 2012
    Posts:
    4
    Jay Kay, you are the best! I have been working on a script for a while for a game I am making where the enemy moves kind of like a weeping angel from Doctor Who, but my script was really buggy and the enemy got stuck often and randomly disappeared (still haven't figured out why) but this is really great and I learned a lot of things from this that helped me a ton! I will definitely continue to follow your new series, but I just wanted to say thank you for how much you help us.
     
  36. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Hey DoctorSauce, thanks for the awesome feedback! Am really happy that my videos could help you in some way. I have just finished some more videos and am uploading now, but for you the next ones after these should be interesting. I am building a whole new character controller for the enemy, it will be rigidbody based and have more functionality than the first one. It will still use dot product to determine if the enemy is visible to the player, but as the scripts are now written from scratch in the new videos, hopefully it will be easier to understand how it works. The new videos are not just for Slender, so again I hope you can find something in there helpful to all your projects. It's great to have you watching, have fun =]
     
  37. StevenMANGOS

    StevenMANGOS

    Joined:
    Mar 17, 2013
    Posts:
    1
    First off, thanks for the scripts and tutorials alucardj. However, after using the same scripts as you had, my model moves towards me, but he doesn't teleport. Instead, he just casually moves along as if he was walking but does stop where he is meant to. Do you know of any reason as to why this is the case?

    Thanks.
     
  38. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    My guess is your terrain is not named "Terrain" . If you look in the function TeleportEnemy(), it has a check after the raycast :
    Code (csharp):
    1. if ( hit.collider.gameObject.name == "Terrain" )
    Simply change the string in this check to the name of your terrain. Oh, and thank you for your thanks! I like to help people, but really like to know it too when I have =]
     
    Last edited: Mar 18, 2013
  39. MegaStevenLP

    MegaStevenLP

    Joined:
    Feb 27, 2013
    Posts:
    69
    Hello, im again.
    I started a new Slender Game and the Enemy(Its a Model) follows me but doenst hurts me???
     
  40. Slendyberkay

    Slendyberkay

    Joined:
    Feb 28, 2013
    Posts:
    20
    I had the same problem before this tread was here. And I learnt that it is because of sound. The script requires sound to work!
    So (I think) you have to add sound to Enemy(GameObj.)[Enemy, look inspector and add the sound there]

    Thanks again Jay.
    Sorry bad English.

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Jay, I love horror type games. I dont know have you ever played Dead Space, Silent Hill, Amnesia: The Dark Descent ...

    And I started writing a story. It's concept will be like silent hill. Story : Silent hill Origins \ Character : Silent hill Origins and Shattered Memories mix \ Monsters : a lot of monster types, will have a mix of all these (Penumbra like)

    Story :

    A man who will look like a mix of these two
    http://images.wikia.com/silent/images/7/7d/TravisGrady.png
    http://2.bp.blogspot.com/-3lhydKnAY...arry-mason-silent-hill-shattered-memories.jpg
    Hair and coat from second pic and body mass and moustaches from first pic. He is a truck driver. Everything happens in Nevada.
    He is working with a big company but he doesn't know what is he carrying with his truck. He enters an oil station just before he enters the city and buys a city map and some oil. When he turns back to his truck, He noticed a terrible sand storm coming closer. When he just enters the city the sand storm begins. He cant see more than 5meters and when he saw a woman on the road it was too late. He turns the wheel (IDK what word it was) and brakes. But he crushes the woman before his truck stops. The truck tilts. And when he comes to life. He feels guilty and enters nearby hospital. The were no one and there was blood on floor. When he walks to the bloody corridor a cinematic thing happent. From speaker: #static# Dr[noname] we have a woman from a terrible car accident#static# please #staticccc# And main character looks down. The bloody path continues it's path and disappears after a door. He moves to door tries to open it but the door was locked. When he turns back he sees a monster looking at him! The monster comes closer. He was panicked and tries to open another door. A chase scane begins as he enters the corridor. When he was trying to escape from the one which one is chasing him another one comes in front of him! A mini game like press E repeatedly. And he pushes the monster in front of him. He continues running and opens a door. End of the road. The door was locked in front of him! He looks back to the way he came from, nothing there. Then he finds some documents on a table.(in the same room) He starts reading. The documents say that there is was a drug which has been named PAX-12 (will chance the name later). The drug was made to made people 10 times more powerful. But the drug was lethal. It destroys eveyting in subjects body and turns everything to muscles. Huge muscle with no brain! The door lock opens with a key. A doctor comes in. The doc was wondered at first. Main character starts running out of the room. #a sound(SCREAM)# and runs up stairs. He looks quickly to his left and right. On the left side there were rooms 101,102... and on the left side there was only a cleaning room(What word should I use) and he continues reading documents. First subjects. There are tumors growing in their body due to PAX-12 and memory loss because the drug turns everything to muscle. One of the subjects was died due to PAX and 2 of em escaped. They also report that new people can be infected by infected blood. And the reports say that there is a vaccine for not losing memory. But he couldn't read because the document was lost. (I mean next paper)

    He gets out of the room and the game continues.

    And late in game he finds out that he is one of Pax-12 carrier.

    What do you think about the very beginning of the story. I ll name the game with cure name. Wanna work with scripting. Or any ideas?
    Sorry for bad English(again) an thanks again
     
  41. MegaStevenLP

    MegaStevenLP

    Joined:
    Feb 27, 2013
    Posts:
    69
    Already did, doenst work either
     
  42. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Hi everyone, very sorry for late replies here and on youtube. The past 3 weeks have been mad planning and recording videos, prototyping the next stage as well as trying to fit in my other projects in what little spare time is left. So many things I want to show and share, just not enough hours in the day ....

    MegaStevenLP :

    I really don't know what's going on with yours. All I can suggest is the same things that are in the video. The problem doesn't seem to be the model but the code. Does the model stop moving when you look at it? If yes then StopEnemy() is being called when isVisible. Now DeductHealth() is called immediately before that. Let's check if that is being called : in the function DeductHealth(), add a debug in right before the // Deduct Heath comment

    Code (csharp):
    1. function DeductHealth()
    2. {
    3.     Debug.Log( "I'm Deducting Health!" ); // ADD THIS LINE
    4.    
    5.     // deduct health
    6.     health -= damage * Time.deltaTime
    7.    
    8.     // etc etc
    Let's even add a whole bunch of debugs to the Update. Replace your Update function with this :

    Code (csharp):
    1. function Update()
    2. {
    3.     // Movement : check if out-of-view, then move
    4.     CheckIfOffScreen();
    5.      
    6.     // if is Off Screen, move
    7.     if ( isOffScreen )
    8.     {
    9.         Debug.Log( "Enemy is OFF screen" ); // ADD THIS LINE
    10.        
    11.         MoveEnemy();
    12.          
    13.         // restore health
    14.         RestoreHealth();
    15.     }
    16.     else
    17.     {
    18.         Debug.Log( "Enemy is ON THE SCREEN" ); // ADD THIS LINE
    19.        
    20.         // check if Player is seen
    21.         CheckIfVisible();
    22.          
    23.         if ( isVisible )
    24.         {
    25.             Debug.Log( "Enemy is VISIBLE : Deducting Health!" ); // ADD THIS LINE
    26.            
    27.             // deduct health
    28.             DeductHealth();
    29.              
    30.             // stop moving
    31.             StopEnemy();
    32.              
    33.             // play sound only when the Man is first sighted
    34.             if ( !hasPlayedSeenSound )
    35.             {
    36.                 audio.PlayClipAtPoint( enemySightedSFX, thePlayer.position );
    37.             }
    38.             hasPlayedSeenSound = true; // sound has now played
    39.         }
    40.         else
    41.         {
    42.             Debug.Log( "No, Enemy is not visible" ); // ADD THIS LINE
    43.            
    44.             // check max range
    45.             CheckMaxVisibleRange();
    46.              
    47.             // if far away then move, else stop
    48.             if ( !isInRange )
    49.             {
    50.                 MoveEnemy();
    51.             }
    52.             else
    53.             {
    54.                 StopEnemy();
    55.             }
    56.              
    57.             // reset hasPlayedSeenSound for next time isVisible first occurs
    58.             hasPlayedSeenSound = false;
    59.         }
    60.     }
    61. }
    this should return enough debugs in the console to see where in the script your enemy is, what behaviour it is using.

    Make sure you test this, start with the player really close, and when the enemy is not yet moving, slowly look at him then look away, and check all the console messages. Remember the scripts on my UA link are only up to date for video 7, you have to watch videos 8 and 11 and add that code yourself. But those are just extra stuff, not to do with the problem you are having.

    Apart from that, all I can suggest (without feedback from how you went with the debugs), is to follow along with the new NPC videos, I will be developing it into a Slender enemy, and also something that isn't an enemy, just to show how flexible one script with a few different states can be. This will be better than the original (I hope).

    Slendyberkay :

    Wow, you have some awesome ideas. Really reminds me of PS2 Silent Hill and the old Resident Evils (1-3), but yet it is original. I like many types of games, the ones you mention included. Everything in your start is possible, but it would be learning how to use a state engine to change between player control and cut-scenes. You could load scenes for cut-scenes, but this could become boring and laggy, why have 2 scenes with all the same assets but 1 is for cut-scenes?

    I really like the story, and would like to make some videos showing how to do this, but as I said before I simply am out of time (and a little exhausted) at the moment. After this post I have to make 2 projects for other people (in my real life, not for Unity Answers), and that's just for tonight! AS well as still wanting to do the RTS videos for selecting units and moving them. So much to show, I need me * 3 to make it all!

    I don't have any links showing how to do cut scenes sorry, but I would suggest start learning how to use the Unity Animation window. Create some animations that move your camera like a director, then when your character hits a trigger collider volume, take the control away from the player and then play the animations for the camera and the character (making a cut-scene), then when that animation has finished, return the camera to where it is normally, and give control of the character back to the player. I wish I could give you more, and even make a video to show, but really it's not going to happen this week at least. Don't give up learning and trying for yourself though, try to use the ideas I mentioned, and just experiment and have fun trying to animate a camera through a scene. I want to see one of your finished projects! And your Pax storyline is great, well done =]
     
    Last edited: Mar 21, 2013
  43. Moxiii

    Moxiii

    Joined:
    Mar 24, 2013
    Posts:
    53
    For some reason I've followed the text guide and videos exactly and my Slender man won't follow me he just looks at me. And it won't collect any pages. Someone help?
     
  44. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Do you have any errors appearing in the Console Window?

    Ok, so let's start with one of those problems. Have you watched Slender video 10 : Collecting Papers from Scratch using SphereCast : http://youtu.be/JaOsHCV_SZQ ? Start a new project, then just follow that one video.

    First, import the Unity First Person Character controller.
    Then in a new scene, create a cube for the floor, and scale the X and Z to 100.
    Now, Delete the camera from that scene.
    Drag and drop your First Person Controller into the scene.
    Hit Play, and walk around to check everything is working so far.
    Now continue to follow the video 10
    Create cubes, scale them, and MOST IMPORTANTLY : name them Paper
    Watch the video very carefully, pause it and work on your scene until your scene is the same.
    Now follow along with the script.

    Let me know your results. You must be able to pick up papers, or the whole objective is of the game is missing. The video 10 shows how to do this from a blank scene.

    I have just recorded another video on importing and using a model, I shall post the link when it is uploaded. For now, just fix the first problem, hopefully you will be collecting papers in no time =]
     
  45. Moxiii

    Moxiii

    Joined:
    Mar 24, 2013
    Posts:
    53
    I'm not getting any errors in console and they are named paper. I'm taking pictures now.
     
  46. Moxiii

    Moxiii

    Joined:
    Mar 24, 2013
    Posts:
    53
    Here's one of the script and paper model

    $Capture1.PNG

    It's un-scaled in this picture but they're now scaled
     
  47. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Ok, so the Paper object looks fine. Scale doesn't really matter, as long as it has a collider and is named correctly. That script is not from video 10, so go there, jump forward to 7 minutes, and follow that to make a new collect papers script.. The reason I say this is because you can see how the script is made, all the Unity Scripting References to check out, and most importantly it has 2 Debugs : one to tell what the raycast / spherecast hit, and one drawline that shows exactly where the raycast / spherecast is going.

    Code (csharp):
    1.  
    2. Debug.Log( "SphereCast Hit : " + hit.collider.gameObject.name );
    3. Debug.DrawLine( Camera.main.transform.position, hit.point, Color.red, 1.5 );
    4.  
    once you have that, we can look at what the Debug.Log is returning, and you can see the line where your raycast / spherecast is actually going (if at all). One final check, are you using the E key when running in the Inspector? And I'm on Unity 3.5.7, if you are on 4.1 I just read there are a couple of bugs in that release. But anyway, the script in video 10 and the debug line and log will tell the full story. When that is working, then we can go back and look at adding the audio and interaction with the enemy.

    Here is fine, this post is to help everyone who may be having the same problems. I am recording a new series, and that uses just the video 10 script, so we need to get that working for you.

    Aah, I just saw your distanceToPaper might be too low. This is now set to 5.5, so try that in the inspector (if you change the script, the Inspector won't update unless you tell it to reset).
     
    Last edited: Mar 25, 2013
  48. Moxiii

    Moxiii

    Joined:
    Mar 24, 2013
    Posts:
    53
    I am using E, I'll try the video now. I can show you through join.me if you PM me.
     
  49. Moxiii

    Moxiii

    Joined:
    Mar 24, 2013
    Posts:
    53
    After using the script I was given I got many errors. I'll post main ones

    NullReferenceException
    UnityEngine.Transform.get_position () (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/UnityEngineTransform.cs:26)
    CollectPapers.ClampPlayerToWorld () (at Assets/CollectPapers.js:177)
    CollectPapers.Update () (at Assets/CollectPapers.js:165)

    MissingComponentException: There is no 'Rigidbody' attached to the "Enemy" game object, but a script is trying to access it.
    You probably need to add a Rigidbody to the game object "Enemy". Or your script needs to check if the component is attached before using it.
    UnityEngine.Rigidbody.set_velocity (Vector3 value) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/NewDynamics.cs:517)
    EnemyScript.StopEnemy () (at Assets/EnemyScript.js:204)
    EnemyScript.MoveEnemy () (at Assets/EnemyScript.js:195)

    As I can see only these two were flashed a lot,
     
  50. AlucardJay

    AlucardJay

    Joined:
    May 28, 2012
    Posts:
    328
    Well there's one problem showing right away, your enemy object is not set up correctly. But maybe because you havn't done that part yet? I'm just guessing. But it also explains why he isn't moving, the enemy object is incomplete. Now I said on that paper script to comment out these 2 lines :
    Code (csharp):
    1.  
    2.                 // make enemy follow closer
    3.                 if ( papers == 1 )
    4.                 {
    5.                    // theEnemy.SetFirstPaperDistance(); // comment this out
    6.                 }
    7.                 else
    8.                 {
    9.                    // theEnemy.ReduceDistance(); // comment this out
    10.                 }
    11.  
    because you might not be up to them yet, but the enemy should absolutely already have a rigidbody.

    Ok I got to typing this much and it seems I have a message saying it is working. So all that enemy no rigidbody stuff is wrong? AArrrggghh. I'm now going to blame Unity 4.x for this. Just to be safe, save your scene, then close unity and then re-open the project.

    Now if you can hit play and run around, try picking up some papers, check the console for messages, and check the scene view for that red line where the spherecast is going.
     
Thread Status:
Not open for further replies.