- Home /
BCE0051: Operator '<' cannot be used with a left hand side of type 'Object' and a right hand side of type 'int'.
for( var doorCheckingNow : GameObject in currentCell.GetComponent(AIPathCellScript).doors)
{ // statement that go through the list of every cell in the game
for (var i : int = 0; i <= doorCheckingNow.GetComponent(AIpathDoorScript).cells.length -1; i++)
{
if( doorCheckingNow.GetComponent( AIpathDoorScript).cells[i] == playerCell)
if( doorCheckingNow.GetComponent( AIpathDoorScript).doorsToCells[i] < shortPathSoFar)
// // here is the line doorTocell is a array with objects and it is a function array.
not to sure whats going on, I think it has something to do with a array with object can't be less then a float, Just don't know how to rewrite it the correct way. Any help will be apperciated
Answer by Kiloblargh · Jul 09, 2013 at 04:27 PM
"length" should be Length.
doorsToCells needs to be an array of numbers. I don't understand what you mean by "function array" and I don't think you do either.
If doorsToCells is an array of scripts you have to get a number out of doorsToCells[i] somehow. You probably need to calculate the distance to doorsToCells[i] from playerCell and compare that to shortPathSoFar in the next line.
Your answer
Follow this Question
Related Questions
How to make Headbobber on joystick Android 2 Answers
'GetComponent' is not a member of 'Object'. 2 Answers
Writing javascript for web and android 1 Answer
How To Create Android 3d Game Jump Button 2 Answers
Android Plugin Help 1 Answer