Strange "Bug" with object picking?

This is almost definitely user error, though I’m not sure how.

So, I have my tank. 5 of it. 5 instances of the same tank, that is. One of them has a “player” Boolean marked true. The others don’t. I have set four box sprites to four positions around each tank. The scene begins with these boxes created, but they only follow the player. But the event that sets the boxes’ positions to the points around the tanks has nothing to do with that Boolean; the Boolean only has to do with how the player tank moves v. how the other tanks move. This is odd. What is happening?





Firstly, don’t do this:

Instead, create an event with the beginning of scene as it’s only condition. Then as a subevent have the repeat for each tank and as the actions create and position all the blocks (N, E, W & S) in 4 actions in one event.

I’d also recommend you use the sticker behaviour on those 4 blocks and stick them to the tank in the same set of actions that create the 4 blocks. Then you don’t have to worry about repositioning the blocks as the tanks move - the behaviour does it for you.

Alright. That event was working, actually, but it’s probably better organized to do it your way.

As for the sticker behavior, that would work, but I try not to use behaviors that do what I want for now but inhibit me from doing cool stuff I have planned later, and I want to be able to rotate the tank and still use the same key presses to move the tank in the same directions. Which I don’t think you can stick a sticker to an object and then the sticker follow in a direction rather than on the point of the object on which it was stuck, right? So that wouldn’t support my purposes. (Looking into it now).

picking bug 4
I now know that it is this particular event that does not do what it is supposed to for the NPC tanks. Its as if the action to link the directional blocks to the tanks is screwed up somehow so it only links blocks to the player, maybe? But I mean, somehow, something’s getting in the way of this particular event, and it has nothing to do with where in the event sheet it is (I put it all on its own, on a higher level than even the event groups).

That’s what it appears you are doing - PointX() and PointY() are the positions of a point on the object, and not the direction.


You mean it’s not doing what you want it to do. Try putting that as a subevent of a “Repeat for each Tank

While PointX() and PointY() are tank positions, with the sticker behavior, I can’t change the point on the tank where a block is positioned, unlike with how I’m trying to do it, where I will be able to make the blocks rotate counter to the tank’s rotation from point to point whenever the tank turns.

But I’ll try this.

Okay, yeah, I put the event to constantly change the block position under a for each object of event. Now northBlock is constantly to the north of the tank. It works. Thanks.


That’s not how points work. They are relative to the tank’s position and rotation. If you have a point to the right of the sprite and you rotate the sprite anticlockwise by 90 degrees, the point will be above the sprite.

What you may want to do is have a second, hidden object linked to each tank, with the 4 points. If you place the origin of the tank and the hidden object at the centre, then you can position the hidden object at the same position as the tank, and the 4 direction blocks on the hidden object’s points.