x


Unity 3.0 Cloth Slingshot Settings

Hello UA,

I am creating a game where the objective is to try to launch as many "furballs" in an area as possible. Now, to launch these "furballs" you use a slingshot. So, I decided to use the Cloth feature built in Unity 3.0 to create the slingshot. I have 2 poles that the slingshot will be flung from, and I have a dragable rigidbody that moves on the X and Z axis. I tried messing around with the cloth settings but have no luck in simulating rubber. Anyone know any tips in creating "rubber" or a slingshot type feel?

From, FB9

more ▼

asked Nov 20 '10 at 03:15 AM

Flipbee9 gravatar image

Flipbee9
73 19 20 25

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Don't use physics for everything; hack it. We came up with a great solution for Castle Smash (http://apps.facebook.com/castlesmash)

basically when you spawn a rock on a slingshot, it spawns it at a certain point (referred to from now on as the origin) and then you drag that rock back. There are some functions that use a bit of trigonometry to get the diagonal length of the pull-back. When the user lets go, the object points towards the origin, and then the physics engine activates, and a force is added to the object, proportional to how far back the user pulled.

woiks like magic!

more ▼

answered Jan 29 '11 at 01:39 AM

hypnoslave gravatar image

hypnoslave
436 12 16 25

(comments are locked)
10|3000 characters needed characters left

It won't work remarkably well no matter what you do. I'm (once again) only guessing, but I imagine from the complete absence of fluid physics and the poor cloth simulation, even Unity 3.1 is using a comparatively ancient release of PhysX. I wish someone would help me verify that though, so I know in the future whether they're using old PhysX or just using new PhysX badly (because cloth issues and no fluid is the least of the odd problems, like extremely poor performance compared to PhysX tech demos). :)

The only setting that comes to mind is the cloth setting, I forget what it's named, but in the tooltip it explains that it applies force back on anything that collides with it. I think toying with that setting is your best bet if you really insist on using PhysX cloth as a slingshot.

If you can settle for an alternative, you may want to try stringing together multiple rigidbodies in a chain with elastic-y joints (by playing with the spring and spring damping values). It wouldn't look all pretty and deformative like a single piece of cloth, though. At best, more like a necklace. :P

more ▼

answered Dec 31 '10 at 08:14 AM

Jason B gravatar image

Jason B
1.7k 29 32 44

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3721
x121
x8

asked: Nov 20 '10 at 03:15 AM

Seen: 1554 times

Last Updated: Dec 29 '11 at 12:41 AM