This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Update(){ | |
| GetComponent<Rigidbody> ().velocity = transform.forward * 2.0f; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void SetGazedAt(bool gazedAt) { | |
| GetComponent<Renderer>().material.color = gazedAt ? Color.green : Color.red; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Teleport : MonoBehaviour { | |
| private Vector3 startingPosition; | |
| void Start() { | |
| startingPosition = transform.localPosition; | |
| SetGazedAt(false); | |
| } | |
| } |
NewerOlder