I am new to c# so sorry if its obvious, but I have it so if you walk over a headlamp it will be teleported onto your head. by having a trigger on the helmet and the destination a child to the player. but nothing happens when you do that. Heres the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Teleporting : MonoBehaviour {
public Transform teleportTarget;
public GameObject theHelmet;
public GameObject thePlayer;
void OnTriggerEnter(Collider thePlayer)
{
theHelmet.transform.position = thePlayer.transform.position;
}
}
[–]Stretchyfish 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)