Game Dev Help Thread

I feel like I’ve asked for help a few times on these forums, and it’s been way helpful. This OP will be reserved for stuff ya’ll might find interesting or useful or solutions we find over the course of discussion.

Obviously I started this thread for my benefit, please read if you’re a Unity dude:

So this is kind of a weird thing. I have a Rigidbody object with animated children. When I play the animations inside its children I am getting weird movements in the parent rigid body.

The structure is a parent Capsule. Inside the parent Capsule is a billboarded Sprite. Next to the sprite I have a Tools container object with an Animator component. I turn on/off the gameObjects inside of Tools container (the tools themselves) and run animations via the Tools Animator component. The ground is flat. Whenever I push a button I run this function

public void Stop() { rb.velocity = Vector3.zero; }

you are entering a world of hurt

I’ll look into this later when I’m not at work but I’ve had issues with animations and rigidbodies before.

First and most obvious step is to look at the animation and make extra-sure it doesn’t have keyframes on the parent; the animation editor makes it easy for this to happen accidentally.

Hmm. I haven’t seen this specific thing (with velocity), but I know changing rotation and things of child objects fucks with the parent and it’s a pain in the arse.

edit:

Also are you doing your physics stuff in the right kind of Update() … should be FixedUpdate() I think … I forget things.