Frank glitched nicht in Boden
This commit is contained in:
@@ -49,12 +49,13 @@ public AudioClip fadeSound; // The sound clip to be played
|
||||
edge.enabled = true;
|
||||
gone = false;
|
||||
} else {
|
||||
audioSource.PlayOneShot(fadeSound);
|
||||
yield return new WaitForSeconds (fadeTime);
|
||||
spriteRenderer.enabled = false;
|
||||
col.enabled = false;
|
||||
edge.enabled = false;
|
||||
gone = true;
|
||||
audioSource.PlayOneShot(fadeSound);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,14 +1,18 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
public class respawn : MonoBehaviour
|
||||
{
|
||||
private GameObject player;
|
||||
[SerializeField] private Transform respawnPoint;
|
||||
private AudioSource audioSource; // Reference to the AudioSource component
|
||||
public AudioClip hurtSound; // The sound clip to be played
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
||||
player = GameObject.Find("Frank");
|
||||
audioSource = GetComponent<AudioSource>();
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +24,11 @@ public class respawn : MonoBehaviour
|
||||
{
|
||||
if (other.gameObject.CompareTag("Player"))
|
||||
{
|
||||
try{
|
||||
audioSource.PlayOneShot(hurtSound);}
|
||||
catch(Exception e){
|
||||
;
|
||||
}
|
||||
player.transform.position = respawnPoint.position;
|
||||
Debug.Log("Respawn: Move");
|
||||
}
|
||||
|
Reference in New Issue
Block a user