Untitled

mail@pastecode.io avatar
unknown
csharp
2 months ago
447 B
3
Indexable
Never
    private Transform player; 

    void Start(){

        player = GameObject.FindWithTag("cameraPlayer").transform;


    }

    // Update is called once per frame
    void Update()
    {

        if (Input.GetMouseButtonDown(0)){
            Vector3 newLocation = player.forward * 5;
            Vector3 off = Quaternion.Euler(0,0,0) * newLocation;
            transform.position = player.position + off;

        }


    }
Leave a Comment