How do you find the position of a clone?

clones

#1

Short little question...

How do you find the X and Y position of a clone? I've seen it before, but I forgot...

Like, if I needed another object to Set Position to a clone (not the original object), how would I do that?

Thanks!


#2

This post was flagged by the community and is temporarily hidden.


#3

Why are you so depressed????????


#5

Ok, I get it, It is not like have experienced anything scary or something???!?!??!? Looks around to check if nothing is around or any paranormal stuff. Swrry, I saw some creepy stuff before in my h0N3 b3f043. Trying to keep it decoded.


#7

Okay, let's get back on topic!


#8

Back to the question, it is not as straightforward to get the X and Y locations of a clone, as it is to get the X and Y locations of a base object. It can still be done, however. You just have to be willing to jump through some hoops.

I will give you one possible hack. When you create a clone, you can give it a number, often referred to as an "Index". The way you could do that is to assign its number to some other property, like its invisibility or "speed" (which I almost never need for anything else) or size. That means that this property is no longer available for its original purpose.

Once you have assigned the clone number by whatever method suits you, you can use and "if _ equals [index]" and then read the "X position" and "Y position". It's clunky, but it works. I think that may be very similar to what has been suggested above. Not sure. If it would be helpful, I can make an example project that shows this. Interesting?


#9

That'd be great! I thought it had something to do with using a value like "rotation" or something like that, but I never really understood how to apply that.


#10

I would be happy to give you something that is helpful. If you don't mind waiting a few minutes, and assuming that hopscotch will still be up, I will try to make something and bring it to your attention. By the way, yes, you can use "rotation" as the index as well, if you don't mind the fact that your object will be rotated. You have probably understood more than you give yourself credit for. :slight_smile:


#11

Can you post a project for it? And give me the link for it!


#12

I guess you could make the clone set a value to it's x position and another to it's y, then make another object set the text to them.


#13

Got distracted for a minute. Here's a link:

Read Clone XY


#14

You could use speed?


#15

I do. In fact, that's my favorite property to hack as an ID for a clone, to give it a serial number or to keep up with some other made-up property. Since I don't use the "change [x or y] by... " or "turn..." or "go forward..." commands, it makes sense to use "speed" for something other than its original purpose.


#16

You should know, I learnt in from you in your 4D4U, I even know most of the code now!


#17

That's great. I'll be thrilled to see you make something way cooler with it!