Im getting errors like these:
BCE0019: ‘isGrounded’ is not a member of ‘UnityEngine.Collider’.
how do i fix these?
by using the right class. blind guess is that you use JS and forgot that you have to cast it explicitely to the desired class on iphone where no dynamic typing exists.
How would i fix that?
sorry for the dumb questions
Generally you need to statially type every variable you use with JavaScript in the iPhone environment. Example:
Bad - does not compile:
var x = 10;
Good - does compile:
var x : int = 10;
(note the : int in the above example!)
In your case you probably want to assign a collider object to a variable that has not been told to be of the type of collider. Do something like this:
var myCollider : Collider = <code here to get the collider>
Does that help?
im sorry i understand the example you gave but, how would i fix these ones exactly… im brand new to scripting.
collider.motorTorque = motor;
collider.brakeTorque = brake;
collider.steerAngle = steer;
thanks
im sorry for taking your time.
Where ever collide is declared, you need to explicitly tell it what kind of variable it is.
For example:
var collider: Collider;
collider.motorTorque = motor;
collider.brakeTorque = brake;
collider.steerAngle = steer;
ahhh ok … i go it now.
also how do you make it so it knows when you type in code?
like this
[code_]
//put code in here
[/code_]
remove the _ at the end
That’s not correct:
var x = 10;
will compile just fine; there’s no dynamic typing involved. Type inference takes care of that. The problem in this case is that isGrounded is not a member of Collider, like the error message says. It’s a member of CharacterController though. If it worked before, then there’s some dynamic typing somewhere that you need to fix by making sure you’re specifying a CharacterController.
–Eric
var x = 10;
Well, does not for me. In Unity iPhone I need to define the type, otherwise I get compilation errors.
But true on the collider not beeing a member, correct.