Écran tactile à World Point
public void MoveAction(InputAction.CallbackContext context)
{
Vector2 touchPos = context.ReadValue<Vector2>();
Ray ray = Camera.main.ScreenPointToRay(touchPos);
Plane plane = new Plane(Vector3.up, transform.position);
float distance = 0;
if (plane.Raycast(ray, out distance))
{
Vector3 pos = ray.GetPoint(distance);
Move(pos);
}
}
Anil Agba