- Home /
Question by
tgb20 · Feb 03, 2014 at 05:20 PM ·
transformpositionteleporting
Error CS0119 wont go away
I am trying to write a script to teleport my players around. I tried writing one for spawn but I keep getting error CS0119. Here is my script. using UnityEngine; using System.Collections;
public class Teleport : MonoBehaviour {
void Start () {
}
void Update () {
var player = GameObject.Find ("Character");
if (Input.GetKeyDown ("1"))
print("Going to Spawn");
if (Input.GetKeyDown ("1"))
player.transform.position = Vector3(593, 10, 1557);
}
}
Comment
Best Answer
Answer by Narv · Feb 03, 2014 at 05:25 PM
player.transform.position = new Vector3(593, 10, 1557);
Your answer
Follow this Question
Related Questions
Change position of camera on scene load? 1 Answer
Create a straight gradient equation with a grid of 3d objects 1 Answer
Following another object's position/rotation like parent/child relationship? 4 Answers
How can I teleport my player in fixed area 0 Answers
How do you set the initial value of a variable to an objects current position in unity? 1 Answer