Hey, guys. I’m making a Slender horror game and need help with a script that I’m making that allows the player to pick up pages like in Slender. Now, I know what you’re thinking. You’d probably recommend @AlucardJay 's Slender Guide or the Unity3D Slender Kit by MasterDevelopers. Well, I’ve tried both, but, they seem pretty outdated. Can someone who’s skilled with scripting help me create a new Slender “collect pages” script? If so, not only would I appreciate it, but, I’m sure other devs making these kinds of games will appreciate it as well.
Thanks in advance,
DarkwoodProductions
Here’s a video just to give you an idea of how the page collection system works in Slender:
So…
It’s an object, that is limited in quantity with a OnTriggerEnter → if player - player.pagesCollected += 1?
Not sure if I understand where is the complexity.
(btw - if you don’t know how to/can’t be bothered to describe the system you want, why/how would people give you the code to do it?).
The system I’m looking for consists of the following features:
Able to make a certain sound on pickup
Increases the enemy’s difficulty the more pages are collected.
Allows the player to look at/read the page using a splash screen on pickup
Again, if anybody knows how I can get this script to work in Unity 5, I’d really, REALLY appreciate it if you could show me how to do so. Please and thank you!
You do know you’re asking for a collectibles and a difficulty management system without showing any effort from your side, right?
You haven’t even provided timestamps from that video when the effects you want are shown (and the difficulty part is completely transparent from the video unless someone played that particular game).
Define difficulty.
Depending on how you have it set up it might as easy as GameManager.EnemyDifficulty++ or writing the system from scratch.
Easiest solution:
On pickup start listening for a key → if pressed → instantiate a sprite somewhere in front of the camera, destroy(this, timeToRead) or after second button press.
Now here you’ve got to be kidding… Google → press enter
At least you should be able to figure out how to play the sound. That’s in every tutorial ever.
@Kalladystine , alright, I think I’ve got the hang of it. I have a custom-made script that works, I’m just modifying it to make the script better. I specialize in C# but, the script I’m making is JavaScript, which was why I started this thread. Thanks for replying, dude.
This whole reply consists of C# not JavaScript. Now you can read
I know I’m late, but making a page script isn’t tough at all! I recommend to check out my advanced slender kit, it has the script you’re looking for! Btw… basically it’s trigger script. When you collide with the page it detects the collision and the page is disabled this.gameObject.SetActive(false);. To increase the difficulty just decrease the teleportation time from your enemy script something like slenderai.spawnRate -= 9;. To play the sound (I’m telling the easiest method) just follow this script. First mention the audiosource and gameobject in the script
[Header("Page Pickup SFX Settings")]
public GameObject PagePickupSFXContainer; //the gameobject which contains the audiosource required
AudioSource PagePickupSFX; //pick up sfx for pages
then, in the start function mention this PagePickupSFX = PagePickupSFXContainer.GetComponent<AudioSource>(); // PagePickupSFX is the audiosource attached to PagePickupSFXContainer gameobject, then you’re ready to play the sound. I’ve given a little example demonstrating it
if (Input.GetKeyDown(KeyCode.E)) //If E is pressed
{
PagePickupSFX.Play(); //Play pickup SFX
}
. Hope it helps… and again check out my advanced slender kit… it contains this script.