Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
-3
Question by horrorgamer1337 · Nov 16, 2012 at 08:22 AM · musicdeath

Slender Man scripting troubles- Enemy movement, page collecting, music effects, death on contact, and sanity loss

Im making a game based off of Slender: The Eight Pages by Parsec Productions. I got Slender Man in the game....I got the flashlight, sprinting, etc. down, but I need a few scripts. When i collect pages, they dont disapear(this means you can collect one page eight times to win). Ive gotten scripts for it but none of them work. The Slender Man in my game moves fast when youre not looking, but when you are he moves extemely slow. I want him to be idle when looked at but there are no scripts for it, he also walks through walls when youre not looking which would make the game extremely hard. I also want the player to instantly die when in close contact with the Slender Man. For music, I want a script that makes music harsher as pages are collected. Lastly, I want a sanity loss effect to where the screen gets fuzzy when you look at him. I dont want this to happen when looking in his direction but through a wall. I know its probably alot to ask but I need help. If there are any people who are good at writing scripts, help on any one of these subjects would be GREATLY appreciated. Thanks for any help or advice.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by CrucibleLab · Nov 16, 2012 at 08:14 PM

So, let me state the obvious first:

No one's going to touch your question with a 10-foot pole due to the way you addressed your issues - in one big, messy blob of text. Your title alone probably scared away 95% of the community members. I am feeling patient today so let me tell you something more important than just getting this question answered; if you intend to remain a part of this community, that is.

  1. Break down your problem, one at a time if at all possible.

  2. You shouldn't just tell us your script doesn't work. Show us the script.

  3. Be patient and learn from others how to get your questions answered.

If you're unwilling to follow these guidelines, you're probably at the wrong place. Sorry, but it's true. By the way, I will be more than happy to lend you my help if you can do #2. :)

Comment
Add comment · Show 11 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image horrorgamer1337 · Nov 17, 2012 at 12:35 AM 0
Share

Umm okay I hope this is alot better. Im new to this whole question and answer thing and I didnt know it had to be in some kind of neat order....okay so the problem id like to address first is page collecting. I got a script that works okay but the pages dont disappear when collected. Here is the script for it:

pragma strict

script RequireComponent( AudioSource )

var papers : int = 0; var papersToWin : int = 8; var distanceToPaper : float = 2.5;

public var paperPickup : AudioClip;

var theEnemy : EnemyScript;

function Start() { Screen.lockCursor = true;

 // find and store a reference to the enemy script (to reduce distance after each paper is collected)
 if ( theEnemy == null )
 {
    theEnemy = GameObject.Find( "Enemy" ).GetComponent( EnemyScript );
 }

}

function Update() { //if ( Input.Get$$anonymous$$ouseButtonUp(0) ) // use E in editor as LockCursor breaks with left mouseclick if ( Input.Get$$anonymous$$ouseButtonDown(0) || Input.Get$$anonymous$$eyDown($$anonymous$$eyCode.E) ) { //var ray = Camera.main.ScreenPointToRay( Input.mousePosition ); // always cast ray from center of screen var ray = Camera.main.ScreenPointToRay( Vector3( Screen.width 0.5, Screen.height 0.5, 0.0 ) ); var hit : RaycastHit; if ( Physics.Raycast( ray, hit, distanceToPaper ) ) { //Destroy ( hit.collider.gameObject.tag == "Paper" ) if ( hit.collider.gameObject.name == "Paper" ) { papers += 1; //Debug.Log( "A paper was picked up. Total papers = " + papers );

             audio.PlayClipAtPoint( paperPickup, transform.position ); 

             // make enemy follow closer
             theEnemy.ReduceDistance();
         }
     }
 }

}

function OnGUI() { if ( papers < papersToWin ) { GUI.Box( Rect( (Screen.width * 0.5) - 60, 10, 120, 25 ), "" + papers.ToString() + " Papers" ); } else { GUI.Box( Rect( (Screen.width/2)-100, 10, 200, 35 ), "8/8 Pages" ); // Application.LoadLevel( "mainmenu" ); } }

If you know what I need to add to make the pages disappear please tell me and if theres a specific place I need to add it let me know. Thank you

avatar image horrorgamer1337 · Nov 17, 2012 at 12:37 AM 0
Share

Sorry I dont know why it broke the script into pieces, I hope this isnt too hard to work with...

avatar image AlucardJay · Nov 17, 2012 at 12:49 AM 0
Share

Have you called your object with the collider of the page : Paper ?

  if ( hit.collider.gameObject.name == "Paper" ) 

It's right there, read and do my guide again. I also said to ask questions on one of the 2 places I put the guide :/

Edit : before this line, add this :

 Debug.Log( "Ray Hit " + hit.collider.gameObject.name );

what does it print in the console ?

avatar image horrorgamer1337 · Nov 17, 2012 at 01:01 AM 0
Share

Okay let me answer your first question: Yes I named it "Paper" and tagged it as "Paper"

avatar image horrorgamer1337 · Nov 17, 2012 at 01:02 AM 0
Share

I will edit the script and add your line momentarily....

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Mute volume / sound problem 1 Answer

Death Scene (zooms into Enemy's face)? 2 Answers

Play Death Animation After Death 1 Answer

how to play audio when a level is complete 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges