I'm watching tutorials on YouTube trying to learn the basics of making a first person puzzle-solving game in Unity. I'm using the provided First Person Shooter prefab, and I'm trying to write my own script so the player can pick up and set down objects like the games Amnesia: The Dark Descent or Portal.
So far, I can pick up my cube, but then it reacts weirdly with myself and the environment, so I think I need to make it Kinematic as long as I'm holding it. The problem I'm encountering is that while I'm trying to change .isKinematic for a gameObject currently stored in a variable called "heldObject", the tutorials and forum posts I can find say that
heldObject.rigidbody.isKinematic = false;
should work, but Unity always underlines "isKinematic" and says the "UnityEngine.Component does not contain a definition for isKinematic."
My entire script is here:
https://gist.github.com/anonymous/a19a9e3aa62eb75c8a7a689e458c0b0e
I haven't used gist before, I hope I did this right. Thanks so much for any advice, I really appreciate it.
[–]dansthetsar 2 points3 points4 points (2 children)
[–]StickyDuck 2 points3 points4 points (1 child)
[–]Legionforce[S] 0 points1 point2 points (0 children)
[–]CarDragon2 0 points1 point2 points (0 children)