- Home /
Bouncing in 2D Top Down Game
Hi,
I have another question: in my zelda style game, I am able to throw objects. Now, to get a little different behavior than in zelda, I thought about having a little bounciness when throwing an object. The problem here is, I believe, that there is no real "ground" on which the item could bounce, because when throwing, I check the y position of the player and let the object stop falling, when its y value has reached the players y value. There is no problem with bouncing when a wall will stop the object, but what could be done, when there is nothing below. Maybe an invisible gameobject that is located at the players feet and stretched along the x axis a bit? Or is it impossible to do so?
Answer by robertbu · Aug 28, 2014 at 06:42 PM
Assuming you want it to bounce no matter what the 'y' player's height:
Create a Plane. (Before 4.6, you would do GameObject > Create Other > Plane)
Position the plane at the feet/floor level relative to your player
Make the plane a child of the player
Increase the size of the plane to whatever coverage you need...(100,1,100) for example.
Turn the renderer off on the plane, or delete the whole MeshRenderer component
I tried with the plane, but although it has a $$anonymous$$eshCollider and the object to be thrown has a rigidbody2d and a boxcollider2d with "isTrigger = false", it will fall through the plane...
Sorry, I somehow missed the 2D. You will need a BoxCollider2D or EdgeCollider2D. The concept is the same.
Your answer
Follow this Question
Related Questions
RigidBody2D doesn't bounce when too much speed. 0 Answers
Trying to make my own take on Paddle + Ball games, but the physics can't seem to keep up. 2 Answers
2D bouncing ball not bouncing correctly 0 Answers
Problem with Ball Bouncing after Collision 2 Answers
Unity 2D - How do I add the velocity and direction of an object to another object? 2 Answers