Hey guys, I am decently new to coding, so I am not sure what I am doing wrong but im trying my best to get this to work. Any help is appreciated. What I am trying to do, is move my player character up the y axis
a good amount of units when pressing the “G” button on the keyboard, effectively “Teleporting” my character. This is my coding so far, sorry for the lengthy explanation
using UnityEngine;
using System.Collections;
public class Teleportation : MonoBehaviour {
// Use this for initialization
private void Start () {
GameObject player = GameObject.Find ("Player");
if (Input.GetKey(KeyCode.G){
transform.playerpos= new Vector3(0,0,0);
}
}
}