R
R
Roman Tuzov2019-12-05 14:44:37
Game development
Roman Tuzov, 2019-12-05 14:44:37

How in OnDrag to make it possible to move an object not all over the screen, but only up and down (Unity3d, C#)?

With public void OnDrag(PointerEventData eventData)
{
transform.position = eventData.pointerCurrentRaycast.screenPosition;
}
the object will move all over the screen, but only up and down. Tell me how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2019-12-05
@Hutson

Change only a component in the transformy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question