ok i think ill share a bit o code. I have done alot of collision stuff in a previous game of mine, so i know how to check if an object has collided, im just trying to get my physics object types figured out how i would like, here is what i have.
Alllright i figured it out, the issue is that i was putting the physics.setGravity( 0,0 ) before physics.start()
the correct way is as follows
1
2
3
4
| ---------SET PHYSICS---------------
local physics = require("physics")
physics.start()
physics.setGravity(0,0) |
Hehe, yes - that will do that ;)
Well done on figuring it out - glad your bodies are working now!
Peach
btw avoid using "type" as a variable name as it's a reserved keyword. Using it as you are could cause unexpected results.
If you want to use type in the name maybe make a variant.. "objType" or something similar would be ok.
Well spotted, Danny.
We should put up a complete list of reserved words sometime.
I once used a sound file called "break" in a build for Android, totally messed it up, haha.
Peach
Oh wow thats good to know, thanks for the heads up on using "type" ill change to something else!
I just tried changing type to objType in all my variables where needed, and it caused the collision detection not to work...
Post up some code, it shouldn't make any difference :) Must be a slight oversight on some variable.
ok yea got it working, typo on my part, sorry to waste a min of your time, thanks for the help!