Make sure that your First Person Controller is tagged as the player! select your first person controller -> inspector -> tag and select "Player". If you dont see the tag "Player" make a new tag called "Player".
If you've copied the code and it still doesn't work its maybe because you forgot to attach the script TO THE GAMEOBJECT that will be triggered also you maybe forgot to the tag for your Player. To do this go to your player prefab/gameobject -> inspector -> at the top you have a tag thing go there and press add another tag AND type Player (Same as in the script ).And stop asking for code and learn to do it for yourself .
Make sure that your First Person Controller is tagged as the player!
select your first person controller -> inspector -> tag and select "Player".
If you dont see the tag "Player" make a new tag called "Player".
Thanks for tutorial very easy to follow and works perfectly.
My jump scare won't trigger. Any idea what's wrong. I followed every.
It says no definition for "gameobject" (19,18), any thoughts or ideas on how to fix this?
did you make the o on object capital?
Amazing tutorial thank you.
my jumpscare isn't stoping it is just a loop pls help me
I'm new to unity and I don't know how I'm gonnaa follow the script part please put it in description
Thank you ;)
i made it and the audio isnt playing
help
How much course for the unity Codding 🔍
I figured it out.
whats was the problem/fix?
@@penguinblox1856I will look at it later and get back to you. I don't remember it off the top of my head.
for me it sais other does not exist oin the current context
Can you pls add the script in comments it dont work for me i think i did the script wrong
If you've copied the code and it still doesn't work its maybe because you forgot to attach the script TO THE GAMEOBJECT that will be triggered also you maybe forgot to the tag for your Player. To do this go to your player prefab/gameobject -> inspector -> at the top you have a tag thing go there and press add another tag AND type Player (Same as in the script ).And stop asking for code and learn to do it for yourself .
Plz bro script link
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class jumpscares : MonoBehaviour
{
public GameObject JumpScareImg;
public AudioSource audioSource;
void Start()
{
JumpScareImg.SetActive(false);
}
private void OnTriggerEnter(Collider other)
{
{
JumpScareImg.SetActive(true);
audioSource.Play();
StartCoroutine(DisableImg());
}
}
IEnumerator DisableImg()
{
yield return new WaitForSeconds(2);
JumpScareImg.SetActive(false);
}
}
Add pls scricts
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class jumpscares : MonoBehaviour
{
public GameObject JumpScareImg;
public AudioSource audioSource;
void Start()
{
JumpScareImg.SetActive(false);
}
private void OnTriggerEnter(Collider other)
{
{
JumpScareImg.SetActive(true);
audioSource.Play();
StartCoroutine(DisableImg());
}
}
IEnumerator DisableImg()
{
yield return new WaitForSeconds(2);
JumpScareImg.SetActive(false);
}
}