After importing the dragrigidbody.js script to my project and try to build I get this error. How can this be as this is a script taken straight from the standard package?
isKinematic is not a member of UnityEngine.Component
Do i need to import some other script? Is this not supported in Unity Iphone??
cheers
P.S I am very new to this(as you can probably tell :roll:
I think that the problems may be due to the following lines of code:
26: if (!springJoint)
27: {
28: var go = new GameObject("Rigidbody dragger");
29: body = go.AddComponent("Rigidbody");
30: springJoint = go.AddComponent("SpringJoint");
31: body.isKinematic = true;
32: }
In particular lines 29 and 31 are suspect. Line 29 adds a component (Rigidbody), but body is then of type Component and not of type Rigidbody (thus the error about isKinematic not being part of a Component, when it is part of a Rigidbody component in specific). I think that the easiest fix is like this:
26: if (!springJoint)
27: {
28: var go = new GameObject("Rigidbody dragger");
29: go.AddComponent("Rigidbody");
30: springJoint = go.AddComponent("SpringJoint");
31: go.rigidbody.isKinematic = true;
32: }
We have a reference to the game object, after adding the rigidbody component we can access it straight away. Try that!
OK. I jumped the gun. Thanks for pointing it out My partner is developing the model and I’m doing the scripting and iPhone prototyping. We have a game which builds and runs on Windows in the Web Player. I purchased the Unity upgrade and iPhone module and have not been able to build and run the model once. When I saw the other post with a similar error I assumed it was related to my script.