Forum rules - please read before posting.

Drag and drop physics puzzle

Hi, I'm trying to work out a method for creating a simple spelling game. I have letters at the bottom of the screen, movable physics objects, and i would like to be able to drag and drop them to a highlighted area at the top of the screen. eg- The word 'Dog' is at the top of screen, With dashed lines making it visible. At the bottom i have d,g,o objects.
I would like to click on each letter, drag up to the correct area, and release. If the letter is dropped in the correct area, then the letter will be placed in the corresponding area, otherwise it will just snap back to the original position .

I'm trying to make this work on a touch screen device.
It doesn't necessarily need to be physics based, i just figured that's the easiest way to get objects moving.

Thanks for any help.

Comments

  • edited July 2020

    You could do this with PickUp physics objects by defining an Interaction on let go, which moves the object either to its original position, or the highlighted area it's over.

    To check which, you could use a Trigger over the highlighted area to update a variable that tracks where the object is.

    However, it sounds a lot like how the "Puzzle template: Item arranging" behaves over on the Downloads page - or at least close enough to tweak to get the way you want.

  • Hi Chris. The puzzle demo is indeed close to the concept.After digging into it,i see that there are three scripts helping to run the show. These scripts,or similar would be required for this idea i assume?
    They looked a little bit complex for myself to understand or script.
    I suppose i could mimic them with playmaker if needs be.
    The puzzle template has been very helpful, along with the pdf. Cheers

  • These scripts,or similar would be required for this idea i assume?

    Yes - the template is intended as a demo on how custom scripts can be used to integrate custom gameplay.

    In what way does it differ from what you're after? It may be that just a bit of tweaking is necessary.

  • I think my concern was that, using those scripts going forward i would get into a tangle if i wanted to make changes with a lack of understanding of scripting.

    One difference would be that i would like the objects to be 3d draggables.
    I see in the demo they are sprites. I did swap these out for meshes, but when you drag them, they become inventory item sprites for the drag, This may not work if my puzzle pieces contain animated features eg- The puzzle piece is a little character, when you pick him up he wriggles trying to break free etc

    Further into development i may want to treat these objects like jigsaw puzzles, where the pieces can also be rotated and then dropped.

    Is it okay to use these scripts commercially?

    Cheers

  • when you drag them, they become inventory item sprites for the drag

    Ah, I was forgetting myself. I'll look into updating this template with an option to have the scene object itself follow the cursor when held.

    Is it okay to use these scripts commercially?

    It is.

  • Done - download again, and the "Puzzle" object will have an option to have the selected object move with it.

  • Wow Chris...... You're taking the number one spot for tech support over here.
    Thanks.

  • Hello! I know this is an old post, but I'm trying to do the same as chungaflomper.

    I have already change the object to move with the cursor, but a random inventory item remain above it. Is there a way it has nothing to do with inventory items so it just move the object without the inventory item? Or do I have to create an empty inventory item for this? Thanks in advance :D.

  • In the Cursor Manager, set the When inventory selected property to Change Hotspot Label.

  • It works thanks :D

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.