Reference a Clone
-
How do I reference a clone sprite? I’m trying to use 2D physics to make a rope, I have a loop spawning each clone with a clone ID that is one higher then the last and a local sprite variable isClone to tell if they are a clone or not, when I manually press create a clone and check a physics block sprite input it shows multiple of the Rope sprite’s name with all checked off when I check any of them, I can provide a screenshot or project link if this is too confusing.
I just need to reference the entire sprite of a clone, not just a property of it like possible in the sensing block property of sprite. (PS: Sorry that this is very long, I gave some context alongside the question so people wouldn’t need to ask me so many questions)
-
@jaysen4games-gmail
Hi, it would be great if you could provide a project link. We will help you find a solution. And thanks for the detailed description. That helps a lot.
CreatiCode
-
@info-creaticode https://play.creaticode.com/projects/c1b14a54d877d843799b4655
in the rope sprite I tried to use clone id-1 but it didn’t work and ended up having them attached to nothing -
@jaysen4games-gmail
Thanks for the project link. That’s an interesting project.
You are right that there is no simple way to refer to the clones when setting the rotation axis. We have just made an update to support it using the format of “sprite name|clone id”.
As shown below, the first clone would link to the sprite named “Rope|originalsprite”, since the original rope sprite’s clone ID is “originalsprite”. The second clone would link to the sprite named “Rope|1”, which is the first clone. The same for the remaining clones.
The demo project is shared at https://play.creaticode.com/projects/650b8f77fe0a145f53bbdaf8
-
@info-creaticode thank you, I’ll update the project with this format
PS: I had to refresh the page to post this and it was giving me a popup denying me posting saying “Forbidden”, I think it’s cause I left this tab open for technically over night but something to note
-
@jaysen4games-gmail
Yes, that’s most likely due to a timeout from a long idle period.