#humanoid, joints throwing agent around the room

1 messages · Page 1 of 1 (latest)

tender bane
#

making a thread

merry socket
#

Make sure the balls don't have colliders

#

@tender bane

#

The default sphere object has a sphere collider

#

Did you add joints to the spheres too?

tender bane
#

yeah, unfortunately still happening :( All of the colliders and joint collisions are disabled, and I have another script that is disabling the collision for each ball with the rest of the limbs. so no internal collisions on them at all

#

yes! It might be an issue with the relativity of mass on the humanoid, but even with the balls at an incredibly low mass it's still happening

merry socket
#

Yeah avoid adding joints to them. The joint usually always affects the other body in some way

#

Just make the spheres children of the bones or something

#

With no rigidbody, no collider or anything

#

These spheres dont need any physics because it's for visualization, right?

tender bane
# merry socket These spheres dont need any physics because it's for visualization, right?

They need the physics because of the desired result (joints touching ground, agent can learn to use the joints, etc)

I was considering parenting them but there's always the issue with scaling. The unity ml-agents walking project has an empty parent for each limb, and then a child for the mesh and a child for the rigidbody. That seems like a nightmare to work with 😆

#

But having a rigidbody as a child of another rigidbody is also a big issue... just remembered that

merry socket
#

Unless the child (and parent?) is kinematic i guess

tender bane
#

Maybe combining the mesh would be a solution

merry socket
#

You said it's just for visualization

tender bane
#

there is a sphere on the end of each "hand" and "foot" that DO need physics interaction, but leaving those on doesn't seem to be causing an issue. probably because it's the end of the chain

merry socket
#

They can still have a collider if they are a child of a limb rigidbody

#

It will become part of the rigidbody

#

The sphere itself doesn't need its own rigidbody

tender bane
#

incredible information, thanks!

#

that's how I'm going to proceed then, and I'll work around the scaling issue

merry socket
#

Try to keep your rigidbodies at 1,1,1 scale

#

Each limb can have a separate child for the visuals (mesh renderer + mesh filter), and you can scale the child

tender bane
merry socket
#

It's just a good rule of thumb when working with physics

tender bane
merry socket
#

Other uniform scales are probably ok too, like 2, 2, 2

merry socket
#

Box collider would align better with the visuals if you use a box mesh, but capsule is probably more stable for ragdolls

#

Since it's smoother

tender bane
#

very interesting, really appreciate the help! I'm going to try this heirarchy out :)

merry socket