Welded Blocks
-
I need help to make blocks that stick together until force is applied to it. Can someone help me?
-
I assume you are using the 2D physics engine. You can use the “fix relative position to [OBJECT]” block to make one object remain the same relative position to another object. You need to make sure they are positioned next to each other before running that block.
To break them apart, you can use the “remove relative positon constraint” block.
Here is a demo. The 2 boxes are welded together initially, but when you click the green box, it will remove the constraint.
https://play.creaticode.com/projects/6702f17a72890f104819adea
-
@info-creaticode Thanks for the example! Do you have any way to do this for clones of one sprite?
-
If you are using the 2D physics engine, then each sprite corresponds to one physics object.
You will have to create clones of both boxes, and bind them together when they are created in your code.
-
@s9205307-810c679a I’m not too familiar with 2d stuff since I use CreatiCode for it’s 3d blocks more, but wouldn’t you be able to use the When I start as a clone hat block, and then do the welding from there? Maybe try that
-
@info-creaticode yeah but how would I show this using clones?
-
@s9205307-810c679a CreatiCode added clone reference after a request in 2d physics I made, to reference clones it’s “spritenname|cloneid”, which can just be one join block
Join(sprite|)(clone id) -
@tyller_ can you show the example?
-
We will provide an example.
-
The example project above has been updated to create 2 clones of each box, and set up the fixed relative position constraint between them.