#How can I change a Shape / MutableShape?
1 messages · Page 1 of 1 (latest)
PointerEvent CastRay() https://docs.cu.bzh/reference/pointerevent
then you can see which object you hit with the ray and then act accordingly
actually, I already have the onclick function, but, if I just want to replace the shape by another, do I have to create a new Shape, or can I just change the already existing one?
If it’s a mutable shape then you can edit the blocks and turn it into something else
If you just want to turn the thing into something else entirely I’d recommend hiding the shape and showing the other one in the same position (object.IsHidden)
The way memory works, you’ll have both objects loaded anyways, so there’s no point replacing it somehow. Better to just hide one and show the other. Apparent outcome is the same
and then if you want physics to still work you can make it so that the position of the object that is hidden is constantly being set to the position of the object that is shown currently