#respawn trigger dose not work

1 messages · Page 1 of 1 (latest)

tranquil leaf
#

well when i enter the trigger it only takes the collider with it but not the player

using System.Collections.Generic;
using UnityEngine;

public class Respawn : MonoBehaviour
{
    [SerializeField] private Transform player;
    [SerializeField] private Transform respawnPoint;

    void OnTriggerEnter(Collider player)
    {
        player.transform.position = respawnPoint.transform.position;
    }
}
brisk dust
#

this is because you are hiding Transform player with Collider player, just change the name of the parameter

#

I bet you your IDE even tells you that it hides it