Defense game 2 objects together?

How can I set it so that when I buy a cannon it only spawns on these plus signs no matter which one and best of all that you change the cannone to another plus sign so that you don’t get it in the battlefield above or anywhere else so again briefly prepared Kannone spawns directly at any plus point and you can only move it further with plus point

Have an event with condition to pick a random plus point object, the action to position the Kannone at the plus point’s x & y positions.

Can you explain this in a bit more detail?

I didn’t create any events for the plus point because I don’t know what to add to the events, that’s something new for me. Could you create a small example for me please?

I mean if I move my cannon you can move it anywhere no matter where it shouldn’t leave the area with the many plus points. If you add the cannon to the battlefield above it should go back to the plus points automatically because that shouldn’t be allowed I don’t know how to explain it quite like that, I’ll make a little video if that’s ok

This is something you should be doing by yourself. If you need someone to show you how to add a pick random object (which is pretty much the wording of the condition) or place an object at the position of another object, then maybe you should go over a few of the GDevelop tutorials before continuing.


So by way of drag drop behaviour? You’ll need to store the cannon’s initial position, and if it gets dropped in the wrong place then position it back at the initial position. To determine if it’s dropped in the wrong place should involve checking of it’s been dropped (that is a condition of the drag behaviour) and is colliding with the battlefield.