Jump to content

  • Log In with Google      Sign In   
  • Create Account


Unity Question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 questionsaboutgames   Members   -  Reputation: 103

Like
0Likes
Like

Posted 17 May 2014 - 12:24 AM

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



Sponsor:

#2 frob   Moderators   -  Reputation: 19836

Like
0Likes
Like

Posted 17 May 2014 - 01:03 AM

Physics objects do not need to be visible. In response to the touch you could add and attach the physics objects as needed.
Check out my personal indie blog at bryanwagstaff.com.

#3 questionsaboutgames   Members   -  Reputation: 103

Like
0Likes
Like

Posted 17 May 2014 - 10:25 PM

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



#4 frob   Moderators   -  Reputation: 19836

Like
0Likes
Like

Posted 18 May 2014 - 06:32 PM

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.
Check out my personal indie blog at bryanwagstaff.com.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS