How to Properly Move Two Attached Kinematic Rigidbodies
I have a player character, which has a kinematic rigidbody since it's controlled by a script.
The player character carries an axe, which has a rigidbody that I set to kinematic when I need to move it based on player input, otherwise it is non-kinematic and attached to the player's kinematic rigidbody with a fixed joint.
Questions:
if I want to move or rotate the player character to some position (i.e. they step into a trigger and I want a script to temporarily take control) I know I need to move the rigidbody with MovePosition and MoveRotation - do these functions need to be called in FixedUpdate since these are physics functions? Or does it not matter since it's a kinematic rigidbody?
similar for the axe, when I set it to kinematic to move/rotate it with a script, does that movement/rotation need to happen in FixedUpdate?
when its time to un-holster the axe from its shoulder position and move it with player input, I set the axe's rigidbody to kinematic and let a script take over its movement and rotation - do I also need to break the fixed joint that attaches the axe to the shoulder position? would my script be fighting its physics in any way if I didn't?
lastly, if all this needs to be happening in FixedUpdate, do the coroutines that execute MovePosition and MoveRotation need to yield WaitForFixedUpdate? or can they yield null?
Thanks!
Answer by abandon_games · Jan 14 at 03:27 PM
since questions are more frequently answered in the forum rather than here on Answers, I've asked the same question there and have gotten some traction - https://forum.unity.com/threads/properly-moving-two-attached-kinematic-rigidbodies.1220541/#post-7808790
Your answer
Follow this Question
Related Questions
Moving a rigidbody in local space with transform.TransformPoint has unexpected results. 1 Answer
Move a RigidBody with MovePosition up and down 1 Answer
GetAxis being missed in FixedUpdate work around? 1 Answer
How to set velocity from connected Rigidbody? 0 Answers
Why my gravity direction is rotating with transform.rotation? 1 Answer