▶
Unspottable: Blending ragdoll physics and animations
This is a short techincal explanation of our system to blend between ragdoll physics and animation in unity 2019. It came from the need of adding more robots to the scene by dropping them from the sky, so after being ragdolled on the floor they had to get back to an animated state: [previewyoutube=M8ZjZjjrxTg;full][/previewyoutube] The ragdoll of the robots is fairly standard, they have an almost humanoid skeleton but not exactly. It can be achieved on humanoid models following this great Brackeys video: https://www.youtube.com/watch?v=DInV-jHm9rk Once ragdolled on the floor, the first step is to figure out if the robot fell on its front or back. To do that we just compare the vector up of the root bone of our character and the default vector up.
At that point, we want to blend between the positions of the ragdolled skeleton and the animation. That's done by calculating the position and rotation of each bone, using their current ragdolled position and their supposed animation position. So on LateUpdate() after the animation position is calculated: To get the animated bone position, we have to look at the transform on LateUpdate, but for a real humanoid rig, it should be accessible using Animator.GetBoneTransform (https://docs.unity3d.com/ScriptReference/Animator.GetBoneTransform.html) Interpolation of position and rotation for each bone, using a blendSpeed variable to be able to tweak the strenght of the blend:
[ 2020-02-20 12:30:29 CET ] [ Original post ]
Blending Ragdoll physics and animation in Unity
This is a short techincal explanation of our system to blend between ragdoll physics and animation in unity 2019. It came from the need of adding more robots to the scene by dropping them from the sky, so after being ragdolled on the floor they had to get back to an animated state: [previewyoutube=M8ZjZjjrxTg;full][/previewyoutube] The ragdoll of the robots is fairly standard, they have an almost humanoid skeleton but not exactly. It can be achieved on humanoid models following this great Brackeys video: https://www.youtube.com/watch?v=DInV-jHm9rk Once ragdolled on the floor, the first step is to figure out if the robot fell on its front or back. To do that we just compare the vector up of the root bone of our character and the default vector up.
Vector3.Dot(rootBone.up, Vector3.up) > 0
We're only focusing on two cases, up or down but that could be improve to have better animations to get up at different angles.
We can then choose between the two animations:
At that point, we want to blend between the positions of the ragdolled skeleton and the animation. That's done by calculating the position and rotation of each bone, using their current ragdolled position and their supposed animation position. So on LateUpdate() after the animation position is calculated: To get the animated bone position, we have to look at the transform on LateUpdate, but for a real humanoid rig, it should be accessible using Animator.GetBoneTransform (https://docs.unity3d.com/ScriptReference/Animator.GetBoneTransform.html) Interpolation of position and rotation for each bone, using a blendSpeed variable to be able to tweak the strenght of the blend:
foreach (Bones b in skeleton)
{
b.transform.position = Vector3.Lerp(b.transform.position, b.ragdolledBonePosition, blendSpeed);
b.transform.rotation = Quaternion.Slerp(b.transform.rotation, b.ragdolledBonePosition, blendSpeed);
}
I hope that short explanation helps some of you understand the logic, feel free to come and chat on twitter if you have questions!
https://twitter.com/unspottablegame
https://twitter.com/gwendle
And please wishlist on the store page to help us make more content! :)
https://store.steampowered.com/app/1243960/Unspottable/[ 2020-02-20 12:30:29 CET ] [ Original post ]
Unspottable
GrosChevaux
Developer
GrosChevaux
Publisher
2020-10-22
Release
Game News Posts:
79
🎹🖱️Keyboard + Mouse
🎮 Full Controller Support
🎮 Full Controller Support
Very Positive
(552 reviews)
Public Linux Depots:
- Linux Unspottable Depot [383.09 M]
Notice: Local multiplayer only or online with Remote Together. No single player.
Unspottable is a competitive couch party game for two to four players. Blend in the crowd of AI characters, hunt down the other players and use the many different environment specific rules to win the game.
"Walk like a robot and punch like a human!"
Unspottable is a competitive couch party game for two to four players. Blend in the crowd of AI characters, hunt down the other players and use the many different environment specific rules to win the game.
"Walk like a robot and punch like a human!"
Fun for everyone:
- Simple controls: easy to learn, hard to master.
- Competition based on observation rather than action.
- Tutorial to explain game mechanics to first time players.
- Fun feedback. Ragdoll / Endgame nicknames based on stats / Camera shakes / Funny animations and designs.
Competitive party game:
- Competition from the start: in the home screen, players can already get used to the controls and fight each other.
- No information given to the players about their position to push them to discuss, lie and add bluffing to their strategies.
- All the players can control the level selection and fight to select the one they want.
- Different side quests and mechanics with each level, to create new strategies!
- Expert mode for more advanced players
MINIMAL SETUP
- OS: SteamOs. Ubuntu or equivalent
GAMEBILLET
[ 6107 ]
GAMERSGATE
[ 1111 ]
FANATICAL BUNDLES
HUMBLE BUNDLES
by buying games/dlcs from affiliate links you are supporting tuxDB