[SOLVED] Set Width/Height block issue?

So I’m working on a project, and there’s one section of code where the object creates a clone and the clone (a rectangle) sets width/height.

And I wanted to have an identical rectangle-clone on the other side of the player.
So I copied and pasted the code from the first rectangle-clone.

Since the code is the same, the second rectangle-clone should be the same size as the first.
But the second clone is a different size from the first, and I didn’t change any code.
Why’d this happen?

Pic:


First clone is on the left, second on the right. (They’re the rectangles in the background, behind the arrows.)

Also yeah this is my doodle project lol.

Link:
https://c.gethopscotch.com/p/103e2vcp9q

7 Likes

Why is this shown as a reply?

4 Likes

I’m it sure. second post.

3 Likes

Is this because your code was only meant to work with one object? Are you using an object variable?

3 Likes

I’m not using an object variable. (Unless you count the original object of the first clone.)

3 Likes

Check the code in the object being cloned. If you are using Clone ID then it might only be telling that one rectangle to do something, not the other.

3 Likes

I am using clone ID.

Wait did I forget to mention that I copypasted the When Object Is Cloned code from one object to another?

2 Likes

Is it checking for the same object? Also Clone ID won’t work as well if you use multiple objects, for multiple reasons.

1 Like

My point is that if you are using Clone ID, use it. Don’t create another object with the same code, it only breaks your Clone ID system

1 Like

Nope, it isn’t checking for the same clone.

1 Like

Well there is your problem. Or maybe I’m not understanding what you are trying to accomplish

1 Like


Also here’s a screenshot of the copypasted code rule.

3 Likes

I have a few questions:

  1. Where does the image break (like where are the two separate objects code?)

  2. Why do you have both rectangles doing different things if you want them to do the same thing at different positions?

  3. Why are you over complicating the process by using clones?

3 Likes
  1. Where does the image break (like where are the two separate objects code?)
    In the project?
    In these objects.

  2. Why do you have both rectangles doing different things if you want them to do the same thing at different positions?
    That’s the issue. The rectangles should be the same size but they aren’t.
    And the set width/height numbers are the same.

  3. Why are you over complicating the process by using clones?
    I don’t know XD

2 Likes

No the image. Why are you using Clone ID for two separate objects? I mean break in the photograph. Which part of the code is rectangle one and which is rectangle two (in the code)

1 Like

No the code isn’t the same, they are set at different widths and heights.

1 Like

Oh

2 Likes

That’s because one clone outlines the other by being in the back.

2 Likes

So now I am confused…but also don’t use Clone ID for two objects and just do the way easier way of manually coding it, it’s a lot easier

1 Like

This may or may not be because of the fact that images aren’t scaled perfectly. They don’t take up the fill file size (for example a square may be 128x128 but only fills 84x84) and when set size sets the example to 128x128, it will show an 84x84

3 Likes