Unity Question

Started by
2 comments, last by frob 9 years, 11 months ago

I am very new to Unity and I have a question about rendering graphics. Is it possible to have something that is rendered on command (command of a tap) be of variable length. To explain further, let me give an example. There is an object, a crate or whatever, that is being affected by the Physics 2D Rigid Body physics, if you were to push this crate over the ledge of a building, it would just fall as normal. However, I want to build a gameplay element where the player touches (this project is for mobile) another nearby building and what amounts to a "rigid" rope comes from the box and attaches itself to the building, allowing the crate to swing in a circular path according to the physics of this new "crate + rigid rope" object. The reason I asked if it was possible to have something render of a variable length is that the player can shoot out this rigid rope at any time and I need to be able to render this thing based on the given situation. Can anyone help me with this?

I made a diagram to help explain my confusing wording. http://i.imgur.com/QzzzEov.jpg?1

Advertisement
Physics objects do not need to be visible. In response to the touch you could add and attach the physics objects as needed.

could you explain how to accomplish what I am going for?

could you explain how to accomplish what I am going for?

There are many tutorials out there for rope-style physics in Unity. They range from a series of bend-only hinge joints to stretchy elastic physics objects to fairly complex custom physics objects.

Once you figured out the style of rope physics, implement the rope. I don't know what tutorial you will choose to follow, but most rope physics are just a bunch of short segments attached to each other in a long chain. After it is implemented, attach one end to the object you are interested in, attach the other with the location you are touching. The most difficult part will be implementing the rope, and that isn't even very hard, no more difficult than building a linked list or any other simple chain.

This topic is closed to new replies.

Advertisement