Runtime error 216
Moderator: Moderators
Runtime error 216
I'm trying to make simple game where you can drive car. Unfortunately I get runtime error 216. Most likely my fault, because I'm net to this soft, so I attaching my project.
- Attachments
-
- car.zgeproj
- (4.62 KiB) Downloaded 462 times
Hi and welcome to these forums!
You get a "null pointer referenced in expression" error in the log window too. The problem is in Car.OnUpdate.Condition.Expression:
"return CurrentModel.CollidedWith.ClassId == Ground.ClassId;"
CurrentModel.CollidedWith is only valid to use in OnCollision. So move this Condition to Car.OnCollision instead.
You get a "null pointer referenced in expression" error in the log window too. The problem is in Car.OnUpdate.Condition.Expression:
"return CurrentModel.CollidedWith.ClassId == Ground.ClassId;"
CurrentModel.CollidedWith is only valid to use in OnCollision. So move this Condition to Car.OnCollision instead.
Thanks! However now I have another problem. Wheels of my car don't want to rotate. I'm using following script in Keypress binded to W key. I'm attaching project file. KeyPress is in OnUpdate.
Also sorry for noob questions, but I'm new to it aaand, you know.
Also sorry for noob questions, but I'm new to it aaand, you know.
- Attachments
-
- car.zgeproj
- (5.51 KiB) Downloaded 486 times
Hej Ville,

K
Because Windows returns the QWERTY key events in the 0x41 - 0x5A range, which corresponds to the capital letters in the ANSI map. The lower case ordinals actually map to the numpad and function-keys among othersVilleK wrote:For some reason I can't remember the keys need to be specified in caps.

K