Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 oquendo · Apr 19, 2011 at 04:18 PM · bounce

Object should be bouncier

I'm building a 2D platform game. In one of the modes, if you hold the mouse button and approach a GameObject that has a collider attached to it, a collision occurs. I achieve this by placing, while the mouse button is being held, a game object with a sphere collider where the mouse cursor is.

I'd like to achieve a bouncy effect, so that I can guide an object that would bounce on the cursor until it reaches a given goal. The gravity is set very low to allow time for reaction.

The thing is, the object I'd like to guide only bounces when I approach it as it is lying on the ground. Once it's airborne, the cursor's collider holds it in the air, but there is no bounce to the collision.

I've tried by adding an hyper-bouncy physics material to both colliders, to no avail. I also read about the problem with skin widths, but as far as I understand it, that's only an issue for character controllers.

Perhaps this is all a little fuzzy, but do you have any idea what could be preventing my object from behaving more "bouncily"?

Comment
Add comment · Show 1
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 oquendo · Apr 19, 2011 at 04:38 PM 0
Share

I just realized that with the Physics $$anonymous$$aterial added, the object bounces against other objects, just not against the collider I manipulate with the mouse. Still a problem.

2 Replies

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

Answer by Justin Warner · Apr 19, 2011 at 04:32 PM

Can you put on a physics material? I'm not really following what you're saying, but it sounds like you can use the Rubber or a custom physics material: http://unity3d.com/support/documentation/Components/class-PhysicMaterial.html

Hope this helps!

Comment
Add comment · Show 7 · 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 oquendo · Apr 19, 2011 at 04:33 PM 0
Share

I did! actually, I just edited the original question to explain just that.

avatar image Justin Warner · Apr 19, 2011 at 05:03 PM 0
Share

Ahhh, I see what you mean, was trying to understand... Alright... Thought about it... Can you do something with like, get the point of contact/collision, and from there actually add a force to the object? Then it'll "push" the object? http://unity3d.com/support/documentation/ScriptReference/Collider.OnCollisionEnter.html $$anonymous$$ight help... This is the only way I can think of.http://unity3d.com/support/documentation/ScriptReference/Rigidbody.AddForce.html

avatar image oquendo · Apr 19, 2011 at 05:14 PM 0
Share

What puzzles me is that, if I wait until the object is lying on the ground and then I approach it, THEN it works. The object shoots in the air like crazy...

avatar image oquendo · Apr 19, 2011 at 05:24 PM 0
Share

$$anonymous$$aybe it's related to the fact that, if I approach the object from below, it's been colliding with the ground, which is an object with a collider (but no rigidbody), then it leaves the ground and immediately meets the object, and collides with it in an irregular way?

avatar image oquendo · Apr 20, 2011 at 10:21 AM 1
Share

The addforce statement sort of worked, although the gameobjct becames all jittery after every collision. I'm creating a new question with that problem and giving your answer my O$$anonymous$$. Thanks!

Show more comments
avatar image
0

Answer by oquendo · Apr 22, 2011 at 09:15 AM

A piece of advice for anyone trying to achieve similar results. A few days after this thread I found out about AddExplosionForce, which may work better than AddForce in some cases (it did in mine).

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

How do I make my GameObject "jello-y" so that it will mold and bounce? 1 Answer

Bouncing character like on a pogo stick 1 Answer

Collisions are driving me mad! My sanity is fading fast... 3 Answers

Bouncing Ball Effect 2 Answers

Player Bouncing off Walls 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges