- Home /
Ragdoll Manipulation trickery Help.
I'm Making a game similar to Air Voltar, one of those games you kick a player across a map and collect things before you ultimately come to a stop. The way I decided to handle it was when the player is kicked his x.position is kept exactly the same except his velocity in the x is applied to the scenery around him. which means i can have a box scene and have items spawn off screen without having to loop any terrain and such, just certain building's and stuff go past. It worked fine until i tried to make the player a ragdoll model and it just goes miserably wrong, It looks fine when he i sin the air but the minute he comes in contact with the ground he start to move in the x position backwards and awkwardly,jittery, kind of like my code telling his x position to not change and part of his rigid body physics are conflicting somehow.
here is some code to help
void FixedUpdate ()
{
GameObject[] gObjects = GameObject.FindGameObjectsWithTag( "Moving" );
Vector3 position = transform.position;
position.x = startX;
transform.position = position;
}
I have a feeling it's because i don't know how rag doll hierarchy works properly with the rig and root and parent and stuff and all the components that make it up, that is causing the problem..
Essentially I want him to act like the rag doll is moving as it normally would but never move in the X position without constraining it, because that causes it's x velocity to always equal zero which wont do.
Have you rammed into any colliders (such as buildings) yet? Do you plan to? I'm guessing that the results of a Translated static collider hitting you will look so horrible that you'll just let the guy move, and decide looping terrain tiles isn't so bad.