• Implementations

    Drag and Drop Using an Arrow in Unity

    Since Chambergon Battle Logic (CBL) is a card game — and players often need to actually put together the contents of a card — we need to be able to drag and drop stuff. Here’s how I am currently implementing drag-and-drop functionality in the early stages of remaking CBL in Unity. Instead of moving the object as it is dragged, I draw an arrow from the point of the initial click to the current mouse position. For the arrow, I have adapted ShawnFeatherly’s approach from Unity Answers as follows: //This doesn’t need to be public, but it helps when you’re initially trying to find the right size public float arrowheadSize; Vector3…