0
\$\begingroup\$

Basically I have a task where the player will be able to drag an object (as UI Image), and place it inside a bag (another UI image).

What's the best optimized way to do so? As I researched, I do not think that using colliders for images is the "best" way to do it. Additionally, I was thinking about checking if the position of the image while dragging overlaps an element; however, I do think that would be performant as that would require checking the position on each frame instead of "OnTriggerEnter".

What would be the best way to implement such function?

Thanks & Regards, HurpaDerpa

\$\endgroup\$
  • 1
    \$\begingroup\$ What specific problem do you anticipate that's leading you to avoid using colliders? Did you try it, or your position checking method, to evaluate whether they meet your needs? Gobs of successful games run great with hundreds of colliders or position checks each frame. Do you have measurements that suggest that your game will struggle with this? \$\endgroup\$ – DMGregory Jul 27 at 23:24
  • 1
    \$\begingroup\$ This looks to me like premature optimization. \$\endgroup\$ – Vaillancourt Jul 28 at 1:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.