- Home /
physics Material 2D not working !!!!
I have a cube GameObject to i have applied a physic material. the Cube game object has RigidBody2D BoxCollider2D and trigger
the ground has BoxCOllider2D
Why is it i am not getting any bouncy effect
1) Is it because i am using not physics based CharacterController2D by prime31 ?? 2) or is it because by using trigger for my Cube gameObject
Please help
usually both of the objects should have the physics material. also, make sure that Bounce Combine does not give you 0 by setting it to multiply or $$anonymous$$imum
like if you drop a tennis ball on a lawn it won't bounce because lawn is not a bouncy material
GO to the inspector area look for the mass option under your rigidbody2d play with that on both gameobjects try many values until you get desired This can help in achieving different reactions to gameobjects on collides
First don't use 2D physics with 3D objects. Results may not be same or at all.
Use rigidbody2D on both objects and if you are controlling it through script without applying forces and other physics it will not give you expected results.
Use rigidbody2D and physics class. And for bouncy effect use Physics2D material on ground and adjust bounce value as you want for the effect.
Answer by Trungdv · Dec 17, 2014 at 12:29 AM
I did some test and this is the result:
Case 1: Sprite2d object (box collider 2d - no trigger - bouncy material, rigidbody 2d) and ground (box collider 2d - no trigger - bouncy material). It worked.
Case 2: Object 3d (box collider 2d - no trigger - bouncy material, rigidbody 2d) and ground (box collider 2d - no trigger - bouncy material). It worked.
Case 3: Sprite2d object (box collider 2d - no trigger - bouncy material, rigidbody 2d) and ground (box collider 2d - no trigger - no material). It worked.
Case 4: Object 3d (box collider 2d - no trigger - bouncy material, rigidbody 2d) and ground (box collider 2d - no trigger - no material). It worked.
Case 5: Sprite2d (box collider 2d - trigger - bouncy material, rigidbody 2d) and ground (box collider 2d - no trigger - bouncy material). It did not work.
Case 6: Object 3d (box collider 2d - trigger - bouncy material, rigidbody 2d) and ground (box collider 2d - no trigger - bouncy material). It did not work.
So, it's not depend on object 2d or 3d, it's not depend on ground must have physics material or not if object already had physics material, the ground do not need a rigidbody.
BUT the object's collider must be not trigger.
So in your case, I think the cause is using trigger for the cube. May be CharacterController2D is also the cause, but I am not understand the way it control character, so I can not say certainly it is the cause or not.
hey @Trungv your answer cleared allot of things
When i use 'is kinematic' on my player it doesn't bounces but when it is disabled 'it bounces'
will now i understand that player should work under physics system to be able to get the bouncy feel, is it possible to use bounce on kinematic objects ?
Please reply to this thread
@martin101 $$anonymous$$inematic bodies affect the motion of other rigidbodies through collisions or joints, but kinematic bodies itself is not affected by forces, collisions or joints. It means you can not use Unity physics system to make a kinematic body bounce (because forces can not affect it), you have to create bounce effect by yourself (by code, by animation, etc...)
$$anonymous$$ore details about kinematic body: http://docs.unity3d.com/ScriptReference/Rigidbody-is$$anonymous$$inematic.html
Your answer
Follow this Question
Related Questions
Bumper physics not working, 1 Answer
Why Rigidbody 2d doesnt stop sliding? 2 Answers
Player 2D getting stuck while moving 2 Answers
Enemy bounce from screen edges 0 Answers
While Moving Left or Right my character falls more slowly. 2 Answers