• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by yashesh · Jun 05, 2013 at 04:25 AM · iosrigidbodyslowphysicmaterialcoin

Physics Material slow down the game.

Hello everyone, I have developed game something like coin dozer. And for the smooth movement of coin i have add one Physics Material to each coin but my game is very slow after doing that . Is there any alternative of that or how can i make coin movement smooth without use of Physics material . So can anybody help me to come out from this situation.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Owen-Reynolds · Jun 05, 2013 at 03:10 PM

There seems to be confusion between a physics material and a collider.

The physics material affects how bouncy and slippery the coins are. If you don't have one, Unity still has to make up values, so adding physics materials shoudn't give any slowdown at all (well, unless all that bouncing slows the game down.)

The collider is the shape they "count as." In this case, best to probably build a low-poly cylinder to use as a mesh collider. For example, your coins might have 64 sides, to look round. The same size 16-sided mesh might be a good-enough collider.

If the coins were all on the floor and never stacked, you could use a capsule or sphere, locked to only spin one way, with the "real" floor below the one you see (otherwise the coins would float.) But your coins can stack. A sphere collider forces them to stack like marbles. You could make the sphere smaller, but then the edges of your coins would overlap. Capsules are stretched-middle spheres. They can't be shrunk into a coin shape.

A very short box collider will make the edges of the coins catch more, slide against each other funny, and either overlap or have an extra gap (if the box is scaled to so the coins holds the box, or the box holds the coin.) The coins will act like tiles. You could rotate 3 or more boxes into a ninja star, but then the spiky ends would catch funny on other coins.

It would probably also work to arrange maybe 8 thin rectangular boxes into the sides of an octagon. Adjust one so it sticks straight out with the far side where you want it, then copy the parent, rotate 45 degrees, adjust so the corners meet, then copy/spin that 3 more times.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yashesh · Jun 06, 2013 at 04:47 AM 0
Share

Thanks for reply. I found that the problem is in my Mesh Collider. if i use Box collider then my game works very smoothly. now the last paragraph of you answer will help me. but how can i use multiple box collider into coin mesh? i am new to unity so i am asking this question.

avatar image Owen-Reynolds · Jun 06, 2013 at 10:03 PM 0
Share

Can look up "compound colliders" for the official page. Make several child colliders. This allows you to move and rotate them any way you want. All children colliders are "added up" and count as you having the whole combination.

A trick is to make a cube (which gives a Box collider and the mesh) so you can see what you are doing. Then "click off" the mesh when done.

avatar image
0

Answer by Hotshot10101 · Jun 05, 2013 at 04:27 AM

I would recommend using the Vector3.MoveTowards method. If you look in the help it should be pretty straight forward how to use it to change the transform.position. If not post here again and we can help further.

Comment
Add comment · Show 9 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yashesh · Jun 05, 2013 at 04:29 AM 0
Share

It's not possible. In the game there are approx. 50 coins on the floor and pusher is push to the coin so the coin will move forward that is the game.

avatar image yashesh · Jun 05, 2013 at 04:33 AM 0
Share

@Hotshot10101 any other solution?

avatar image Hotshot10101 · Jun 05, 2013 at 05:09 AM 0
Share

Maybe if you describe the game a little more? If you don't want to describe in public on the forum you can private message me and I will try to help. If you are ok posting more about the game here please do an we can help more.

avatar image yashesh · Jun 05, 2013 at 05:11 AM 0
Share

Here is the video of game : http://www.youtube.com/watch?v=tnWlX24Z00E

avatar image Hotshot10101 · Jun 05, 2013 at 05:44 AM 0
Share

Ah, now I see. Originally I thought you were just talking about moving coins towards some point in a smooth way. You really do need to physics.

What kind of physics material do you have now? Is it a mesh collider? If it is then you could try a sphere or capsule collider instead. I think that will be faster. If you are already using a sphere or capsule collider then I am not sure what might help.

Someone else might have a better idea. The physics components are not my strength.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Clone of Coin Doer Game.Need Help 1 Answer

iOS / iPad slow animation 1 Answer

Add Explosive Force - Coins 1 Answer

[Solved] Is it okay if we change transform.position on a kinematic rigid body which also does not use Gravity? 2 Answers

AddForce doesn't work when used with velocity 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges