• 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 NerdRageStudios · Nov 14, 2014 at 11:38 AM · physicsvector3ragdoll

Weird problems with physics when a ragdoll is added to player model

Hi all, so I am having a weird problem that I don't seem to be able to fix.

I have a character model that is fully rigged and animated in Mecanim. The character is holding a rifle and in order to fire bullets, I have an empty gameObject that is a child of the rifle at the point of the gun barrel end. The transform is set so that the forward is facing in the same direction as the rifle and I instantiate a bullet and addforce on the forward vector and all is good and it works fine.

However, when I add a ragdoll to the character model, the bullets fire straight down at the floor, seemingly in a random fashion. I try to rotate the spawnpoint around, but the bullets just seem to randomly fly out of the gun, no longer following the pinpoint accuracy of them before.

Now, I first thought it was colliders, so I disabled all of the colliders created in the ragdoll process, but no go.

So, I started a new scene from scratch and imported two of the player models and started from scratch.

One I had no ragdoll, the other I created one. Step by step I added the guns, the spawnpoints and all related scripts and controllers.

When I play, the one without the ragdoll works fine, the one with, same again, fires into the floor.

I literally have no idea where to start troubleshooting this, so can someone throw some ideas into the mix please?

Any help would be great and hopefully, I am just missing something silly...

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 NerdRageStudios · Nov 14, 2014 at 11:39 AM 0
Share

oh, the bullets have only got trigger colliders, so its not collisions...

1 Reply

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

Answer by b1gry4n · Nov 14, 2014 at 01:07 PM

From what I understand, you are trying to have the ragdoll and the character bones/mesh active at the same time. OR you are trying to put the ragdoll setup directly on your character.

Typically when games wish to use ragdoll physics, the ragdoll does not exist in the scene until it is needed. When the character dies he is "swapped" with the ragdoll. If done correctly and the ragdoll is positioned the exact same as the character upon activation, the swap happens so quickly you could never notice it or you would have a very hard time noticing it.

Comment
Add comment · Show 3 · 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 NerdRageStudios · Nov 14, 2014 at 02:25 PM 0
Share

Ohhhhhh... Ok, so basically my error was adding the ragdoll to the character that already has everything setup. Right!

If that's the case, I guess I would have it as a disabled gameobject in the player's hierarchy and then de-activate one and activate the other... the only thing is, the model is in T-Pose when activated and there wouldn't be any lateral force applied if he was in motion when killed?

avatar image b1gry4n · Nov 15, 2014 at 04:38 PM 0
Share

you could simply instantiate the ragdoll into the scene at the players position. no need to have it parented or anything.

As for making sure the ragdoll is in the exact pose as the player when its instantiated...thats a bit more tricky.

I use this, a real time saver.

http://forum.unity3d.com/threads/release-urg-the-ultimate-ragdoll-generator.107501/

avatar image NerdRageStudios · Nov 17, 2014 at 11:54 AM 0
Share

thank you, I took the approach of instantiating the ragdoll upon death and it works great :) thank you for taking the time to help

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

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

Related Questions

I want the pitcher to throw a ball to a target a location inside a GUI panel 0 Answers

Collision with rigidbody inside a gameobject 0 Answers

ragdoll disappearing when off screen 5 Answers

how can i attach a ragdoll to my vr controllers,attaching a ragdoll to vr controllers, ragdoll is behaving sparaticaly 0 Answers

Punching objects (C#) 1 Answer


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