How to use physics with a kinematic object

I have a ship vehicle which my character can ride on with the MoveWithObject script, and it works perfectly when I use standard transform and translate functions, but I want to control my ship with the physics engine to add realism, and also because I am using Crest Ocean with it and the system to float a boat on the surface of the ocean uses a rigid body to function.

Is there any way a GameObject with the Kinematic Object script can be manipulated with the Unity p
 
If you are applying physics to an object then it's a non-kinematic object so you don't want to use the MoveWithObject script. You can instead use UltimateCharacterLocomotion.SetPlatform(Transform) and then the character will follow that platform. This has been improved in version 2.2 because of the drive ability so if you are getting jitter I would wait until 2.2 is released.
 
Excellent! I was realizing that kinematic and physics objects were opposites, but hoping I could stick one on the other or some other silky workaround. I'm really glad you have created a way for it to work with both.
I will implement this and see what happens. :D
 
Well, I used that snippet, but my character get's thrown off to the side.
[Tooltip("A reference to the Ultimate Character Controller character.")] [SerializeField] private GameObject m_Character; later down in the code.... characterLocomotion = m_Character.GetComponent<UltimateCharacterLocomotion>(); characterLocomotion.SetPlatform(Vessel.transform);

Here's a video of the outcome, so you know what I mean:
Before I added this line of code he snapped right in place and could pilot the ship. But also the ship's physics were inoperable because I had to use the kinematic object component previously.
 
Seems that my position placement is causing that bug, but when I remove it the character is stuck a at the position on the boat that he initially touches it at. Do I need to change the layer again?
 
Before you get too far I would wait until version 2.2 and the drive ability. This should provide a good example at following any arbitrary rigidbody object.
 
Now that 2.2 is out (So excited!) I want to start writing interfaces for the ship system (which is crest) and the new Drive ability. The only hold up is a new error I'm having starting immediately after the upgrade installation. I posted about it on discord and I can share the link if necessary.
But essentially my character's Ultimate Character Locomotion script deactivates as soon as I hit play. The only error I get is that the kinematic object manager has 1 character recorded but none are in the scene. So the character is recognized before the UCL script gets deactivated.
Of course, this situation makes writing and testing abilities very difficult. I wonder if this is a byproduct of having something set incorrectly.
I can manually re enable the script in playmode though and all errors go away.
I'm in the process of checking through all my other scripts to find if something I wrote is causing it to deactivate.
Is this a common potential/pitfall of using 2.2, if I missed a step or mis-configured something though @Justin ?
 
Last edited:
Top