- Home /
Problem with transform
Hello! I want to do it so that the plane after the collision with the water, change the position of the KKK to the wheels. But while compiling i got error BCE0019: 'transform' is not a member of 'system.type'.
My code:
var wodpart = GameObject;
var wodpart1 = GameObject;
var kolo1 = Transform;
var kolo2 = Transform;
var miejsce = Transform;
function OnTriggerEnter (other : Collider) {
if (other.gameObject.CompareTag ("Water")) {
wodpart1.transform.position = kolo1.transform.position;
wodpart.transform.position = kolo2.transform.position;
}
}
function OnTriggerExit (other : Collider) {
if (other.gameObject.CompareTag ("Water")) {
wodpart1.transform.position = miejsce.transform.position;
wodpart.transform.position = miejsce.transform.position;
}
}
Please help.
For what line do you get this error ? Anyway, using transform for kolo1 and 2 and miejsce is redundant, they already are a Transform.
Answer by Eric5h5 · May 13, 2012 at 08:47 PM
That's not how you assign types to variables; instead it should be
var wodpart : GameObject;
and same for the others.
Answer by whydoidoit · May 13, 2012 at 08:47 PM
The reason you are getting that error is that you are using Transform (with a capital T) which is a type not "transform" which is the current GameObjects transform. You are doing the same with GameObject.
However, did you really mean to have those "="? Looks to me like they should be ":"