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 NeutrinoLite · Jul 06, 2013 at 04:13 AM · collisionforcestrange

Why are my collisions adding massive amounts of force?

I have a prefab that is cloned repeatedly to make a ground upon loading into the game. No issues there. When you right click, more clones are instantiated at the mouse location. This is where the problem occurs. The player runs around on the ground objects just fine. But if the player gets near the mouse instantiated objects or god forbid, touches one, a massive repelling force is applied, and not always after a collision. You can't get near the new objects. The force is applied pre-collision and creates an buffer or shielding effect. Were you to actually make contact you are thrown across the map. What causes this?

The force is always applied on only the X axis. It doesn't always happen with the first 1 or 2 blocks placed. Are the physics being broken all of the sudden? Has anyone ever experienced this or read about it somewhere else?

The player has a Rigidbody (Mass 0.1) and a Capsule Collider. The prefab has a Rigidbody (Mass 1) and a Box Collider. The details of the prefab are identical to both loading time clones and the mouse click clones in every setting from Rigidbody settings to Box Collider settings.

Any theories are much appreciated. :D

Comment
Add comment · Show 2
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 ExplodingCookie · Jul 06, 2013 at 12:41 PM 0
Share

No clue, I am using a similar system in a crate fighting game I am messing with. $$anonymous$$y player has a $$anonymous$$ass 1 $$anonymous$$inematic Rigidbody, and the crates are about half the default block size with a non-$$anonymous$$inematic Rigidbody with a mass of 1. Is your player $$anonymous$$inematic?

avatar image NeutrinoLite · Jul 07, 2013 at 12:42 AM 0
Share

Adding $$anonymous$$inematic does indeed remove the issue, but it also removes the the effect of gravity on the player, which I don't want.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by MiraiTunga · Jul 06, 2013 at 05:56 PM

when you instantiate the objects makes sure you give them the right values ..e.g mass ,drag,use gravity and if it continuous or discrete , also check your scripts if there are fixdupdate or just update

Comment
Add comment · Show 5 · 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 NeutrinoLite · Jul 07, 2013 at 12:41 AM 0
Share

I am fairly new to Unity still, but why would switching from Update to FixedUpdate make a difference with collisions? I am using no forces other than gravity. $$anonymous$$y player moves via Translation.

Also, Unity seems to outright ignore the settings I apply to the prefab. All of the physics settings are correct on the blocks vs the prefab blocks. The player as it turns out, the mass of the prefab is set to .1, the player it creates is changed to .25.

Edit: Also, what physics force on a Rigidbody/Collider would apply at over 3 grid distance? and only after 2 or 3 blocks have been placed.

avatar image MiraiTunga · Jul 07, 2013 at 05:06 AM 0
Share

are you adding force in code ? if u are you shouldn't unless you want special collisions that react in a certain way ...also the player shouldn't be changing to 25 suddenly

avatar image NeutrinoLite · Jul 07, 2013 at 02:56 PM 0
Share

Well I haven't been able to get Unity to create clones from a prefab that keep all the original values. Unity seems to just ignore the values. I have to use Quaternion.Euler(0, 180, 0) because it ignores the rotation information on the blocks when using Quaternion.Identity. $$anonymous$$ost other values seem to have stuck for the moment, but they change somehow.

I am using no forces at all in code.

avatar image MiraiTunga · Jul 08, 2013 at 07:44 AM 0
Share

try setting up the prefab script so that its gives everything the right values in Stsrt() ins$$anonymous$$d of update so that when the prefab swaps start gives it the right values...check if ur scrpit is forcing this values i.e 25

avatar image NeutrinoLite · Jul 11, 2013 at 02:19 AM 0
Share

I had posted a probable solution that I was going to test before closing this, but user Benproductions1 deleted it and wrote me a nasty gram:

"Saying that you will leave a question unanswered, in an answer to the question is fucking stupid. Please repost as a comment."

Perhaps I should have posted the answer without testing to be sure it was correct and left out the details. This forum is a very hostile place it would seem.

avatar image
0

Answer by JonnyHilly · Jun 10, 2015 at 05:54 PM

I had the same issue yesterday.... a truck with no forces apart from gravity, just a box collider and 4 wheel colliders... as soon as it touched the floor, it would rotate, accelerate sideways and fly off up into the sky, pretty awesome and funny... but not very truck-like behavior.

Sooo... what fixed it ?... removed my code that was setting the center of mass... and just let the rigidbody set it, itself.

Turn off any scripts you are running, and make sure the rigidbody behaves as expected "without any other code/scripts running..". drop the object onto a slope or some random objects to test.

Also try not to mix character controllers with physics based rigidbodies...

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

19 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 avatar image

Related Questions

How to add physics to an animation? 3 Answers

Bad grid rigibody3D collision 1 Answer

How to get collision force, not relative velocity? 1 Answer

How do you change the breakforce and break torque of a joint through script. 0 Answers

Disabling Kinematic on hit 2 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