I've spent pretty much the whole of my spare time in the weekend making the physics based rope for this game.
In the end I didn't actually spawn the rope dynamically through code - It was too fiddly and it is hard to get ordering right (things have to be done at certain times otherwise it doesn't work at all). Instead I placed all of the physics hinges into the output I've made, and then when it spawns I draw over the invisible hinge positions to make it look like rope.
The drawing and updating script was made completely from scratch - it updates everything and colours the wire according to how it should be, then positions to end of the wire to either the mouse, or the hub it's connected to (even has destruction code). The drawing code is partly done by a plugin I found which is basically a slight improvement (in terms of functionality and lag) to the line renderer which already comes with unity(which is what i would have used if I hadn't found it)
the physics of the rope will have to be tampered with in order for it to have the desired effect, and the texture made to look less bland, but apart from that I'm very happy (minus the past 48 hours of frustration)
Plain white wire, just clicked.
green and red wire connected (and settled, because it currently jiggles for a while after moving)
I think I will re-do the camera movement next, it's the next biggest thing, The biggest I had to do was the physics wire, so it shouldn't be so bad from now.
No comments:
Post a Comment