“Jedność Zdobądź pozycję myszy” Kod odpowiedzi

Jedność Zdobądź pozycję myszy

Vector3 worldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Troubled Toad

Jak znaleźć jedność pozycji myszy

Vector2 mousePosition = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
Ugly Unicorn

Obiekt jedności do pozycji myszy

//In 2d/UI you can move the object to your mouse position by writing this in a script and then adding it to the object you want to be at the mouse position also put it in the void update spot
transform.position = Input.mousePosition;

//or in 3d
transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition)
Levi Bills

Jedność Zdobądź pozycję myszy

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        Vector3 mousePos = Input.mousePosition;            
    }
}
Funny Fly

Odpowiedzi podobne do “Jedność Zdobądź pozycję myszy”

Pytania podobne do “Jedność Zdobądź pozycję myszy”

Więcej pokrewnych odpowiedzi na “Jedność Zdobądź pozycję myszy” w C#

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu