Hi I ' am writing a 2.5d game which player must move a softbody ball. I wrote a sample game in BlitzBasic3D in the previous year. Now I am building it in unity3d. I have problem with softbody. Questions: How to lock axis in softbody mesh ? Game is 2.5D and i use X, Y Axis How to add a torque a softbody mesh ? Do i have use a attached colliders ? Regards, Leszek
The basics of what you are asking revolve around using a Rigidbody. Look at the documentation for it. For locking an axis you are probably looking for angularVeloctiy. You will need to do it during the FixedUpdate so that it maintains it through the physics part. As far as colliders, for a ball, you need a sphere collider. If you just make a sphere, it already has that collider attached, if not, you will need to add the SphereCollider component under the Components/Physics dropdown.
Hi In Blitz3D i created something like this ( prototype ): http://www.youtube.com/watch?v=UfDr9eD7wKY This softbody ball In Unity3d i use cloth physics for it. How to lock axis in that ball ? Any ideas? Leszek
Add a rigidbody to it (if you don't already have one). In the inspector you'll see "Constraints" under the Rigidbody, expand this and you'll see: Freeze Position: x[] y[] z[] Freeze Rotation: x[] y[] z[] EDIT: This does, of course, assume you are moving the object with the physics engine. If you are moving the object yourself, you'll have to manually constrain it's position/rotation in your movement code.
Ok I use a Constraints but for the cloth doesn't work ;/ I should use parent or something like that ? Do i have use a attached colliders for cloth ? For example: I create a sphere and cloth ball. Sphere is parent of cloth ball. Should i am moving a sphere ( parent ) in my game ? Sphere - > Cloth ball But the problem is. When i use a Constraints and attach rigidbody for cloth, my cloth ball moved in all axis (x,y,z)
Cloth is 3D, it can't be constrained to 2D. You could consider using orth projected camera to fake 2D or you will need to build a spring connected frame to fake it.
what you mean by saying: build a spring connected frame In my unity3d project i use orto camera but i have problem with cloth ball because it's moving on all axis ( x,y,z and rotation ) In should lock translate.position.z and translate.rotation.x and translate.rotation.y. How to lock axis for cloth ? Edit; I attach a unity3d package