I am doing something wrong with fast clone code, but I don't know what. (Solved; had to do with order of code)


#1

I am making a shop using @valgo's fast cloning code. I will remake it in a different project in a second.

Code:

Link to second project:

@OMTL


#2

Please use the POMTL please :wink: Thanks

The code looks pretty awesome!

(Hehe, I see that Minecraft YouTube video in the bottom corner XD)


#4

What is supposed to happen with your code?


#5

Only the original object should do the code.


#6

What code do you mean? The Buy block, Bring to Front or the when Play is tapped?


#7

In the check if else. In buy.


#8

The code in the draft is different now lol


#9

I have no idea what this is but I can say one thing, it is often easy to find the specific order you have to place operations in so try some different ordering.


#10

This code should work.


#11

@Petrichor The code above results in 2 objects having an ID of 0. The original object (by default) & the first clone.

Consider the order of the 2 When Object is Cloned events. The one with Set is before the one with Increase. So the the 1st clone is set to 0 and then the ID is Increased to 1. See? Switch the order.


#12

Yes, I see. When you aid the first object and first clone noticed that. Then I saw you confirming that. Thanks!


#13

Well, I don't know what you are trying to do but this is the fast clone method I use:


I think it was originally made by Valgo but I will have to check.


#14

The one I have is Valgo's. And is also less compe,x than that.


#15

Yes, do think it is faster? Without out the set max clones to 502 block though. I don't know why I put that there XD


#16

I just realized something, infinite clones? Maybe, was t could just be the variables going crazy though. I changed the Set Max Clones Block from 501 to 100000.... and I got a ton of clones and lag XD.


#17

IT was only just over 4000


#18

This project seems cool, I will check it out tomorrow when I will be on my iPad.