I have No Idea Whats going on. This is My first time using a coding language to make a game. HTML and Scratch.com are not real coding things. I dont know anything about the syntax of Csharp dont explain me anything
just give me the code for my problem and nothing else. The object Nothing is in the menu scene i want something to happen to it. This code is on the thing the player has to collide with to destroy the thing in the menu. i tried moving it wile it is dont destry ol loadd but that cant happen so i cant use dont destroy on load because dont destory on load was on Nothing the game object. im litterally so confused rn
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SubwayKey : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag != "Player")
{
void SetTransformX(float n)
{
GameObject.Find("Nothing").transform.position = new Vector3(n, transform.position.y, transform.position.z);
}
void Update()
{
SetTransformX(7.0f);
}
}
}
}