i was able to work around this by passing an old PointerEventData.from a previous function and overwriting the PointerEventData.position with the desired vector3 , i would like to also be able to use this function without the PointerEventData.
public void OnDrop(PointerEventData eventData)
{
List<RaycastResult> results = new List<RaycastResult>();
[B]RC.Raycast(eventData, results);[/B]
foreach (RaycastResult result in results)
{
if (result.gameObject.CompareTag("Items") || result.gameObject == eventData.pointerDrag){ Sort(eventData); return; }
}
eventData.pointerDrag.transform.position = Point;
}
private void Sort(PointerEventData eventData)
{
foreach(Vector3 P in Points)
{
List<RaycastResult> results = new List<RaycastResult>();
eventData.position = P;
[B]RC.Raycast(eventData, results);[/B]
int i = results.Count;
foreach (RaycastResult result in results)
{
if (result.gameObject.CompareTag("Items")) {break; } else { i--; }
if (i == 0) { Debug.Log("Miss"); eventData.pointerDrag.transform.position = P;return; }
}
}
}