Hello!
I’m trying to learn how to control a rigged cube.
It was created in Blender, then I inserted joints in all of its vertices and then interconnected them:
The question is — how do I work with such a character?
The obvious solution is to take all of its joints and work with their rigidbodies:
if (Input.GetButton ("Fire1"))
{
{
GetComponent<Rigidbody>().AddForce(transform.forward * 10);
}
In this case the cube is moving, but rather awkwardly, it starts to spin: Wasteland anxiously teases - Coub - The Biggest Video Meme Platform
I can do it differently.
Just work with the Player object which contains all the joints, and relate to it as a non-physics object:
if (Input.GetAxisRaw ("Horizontal") <= 0)
{
transform.Translate (-Vector3.forward * Time.deltaTime * 3);
}
And it works perfectly: Hitman brightly sparkles - Coub - The Biggest Video Meme Platform, that’s what I need. But as I understand that’s the wrong approach, I need to work with the rigidbodies.
So the question is: what’s the correct way to work with such cube.
It should run, jump and stick to walls.
Thanks.