Jump to content
  • Advertisement
Sign in to follow this  
questionsaboutgames

Unity Unity Question

This topic is 1670 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!