Hello everyone, i’m trying to create an GameObject at the botton of my screen and keep there the whole game. I’m trying to use ScreenToViewportPoint to set the location but i just cant get it write, it keeps instantiating at 0,0,0.
Here’s the code:
using UnityEngine;
using System.Collections;
public class testGO : MonoBehaviour {
public GameObject test;
public Vector3 b;
void Start(){
b = new Vector3(1,1,0);
Instantiate(test, Camera.main.ScreenToViewportPoint(b), Quaternion.identity);
}
}