How to drag and drop an item once!

charliehgreencharliehgreen ArizonaMember Posts: 233
I was wondering how to do I go about completing this task:

1. Drag and drop an item only to certain spots.
2. Once you drop the item, it becomes activated and you can no longer touch the item.

That's it :)

photo Level1_Test_zpsbffbe396.png

Comments

  • TheGabfatherTheGabfather Member Posts: 633
    edited August 2013
    I'm really having a hard time understanding the image you attached, but let me give you clues on how to achieve the results you want as a whole:

    1. Work with Collide/Overlap (at the very least; there are other ways to do this e.g. I prefer tinkering with the abs() function (absolute value) to measure distance for X or Y or X/Y)

    2. Make use of Boolean Attributes which work like True-False toggles

    So when you drag an Actor you're free to move it around but when you drop it, you fire an On Release event listener (Rule) and check its coordinates. If it is anywhere near a specified valid spot, you just Interpolate or Move it to that exact valid spot, toggle your Boolean Attribute to True to signal that the Actor is already in place and cannot be dragged anymore (so naturally you can only drag the Actor while this is toggled False).

    Well, that's how I would do it. Maybe there are better ways to do it :) but give it a try, should be a good learning experience.
  • FajlajpFajlajp Member Posts: 666
    Here is one quick demo I made or you.
    https://www.dropbox.com/s/14oedf1z8fwp9vf/DragAndDrop.zip
    You can drag around the actor but when you release it, you will not be able to drag it anymore.
  • charliehgreencharliehgreen ArizonaMember Posts: 233
    Just downloaded it, Thanks!
    I'll try it in the morning...

    THANK!!!!!!!
Sign In or Register to comment.